几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-07, 12:52 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】relating font types to te

relating font types to text
relating font types to text
hello,
i am trying to read a dwg file with multiple font types described in it. i could get the font file names and the font face from the database using the oddbtextstyletableptr. i wanted to know if there is a way to corelate these font types to the entities (which can be either text, mtext or rtext) in the drawing
thanks.
amit
hi,
i'm not sure i understand what you mean. if you mean some built-in way to find these entities - then answer is no.
oddbtext, oddbmtext references a test style (oddbtextstyletablerecord). you can get text style id by textstyle() method.
oddbtextstyletablerecord stores font information.
oddbmtext is also able to switch font inside it using special character sequence like "abc{farial}bcd
sergey slezkin
problems about cloning a text style
using dwgdirect 1.14.01, i am trying to place a series of ordered marks/flags along a path. my program (a tailored odamfcapp) is meant to load a dwg source file as an xref, and place a block reference in the target file when needed.
one of the entities of the flag file is an attribute definition; that will be properly substituted with an attribute, with custom text, belonging to each block reference.
however, i haven't yet managed deep cloning the text style of the attribute definition: the target file gets a textstyletablerecord with proper names, but with fake properties. performing a wblockcloneobjects makes the same result, so i guess i miss something.
the code follows:
code:
oddbtextstyletableptr targettst = targetb->database()->gettextstyletableid().safeopenobject(oddb::kforwrite);
oddbtextstyletablerecordptr sourcets = attrdef->textstyle().safeopenobject();
oddbtextstyletablerecordptr targetts = oddbtextstyletablerecord::createobject();
oddbidmappingptr map2clone = oddbidmapping::createobject();
oddbobjectidarray obj2clone;

obj2clone.append(sourcets->objectid());
map2clone->setdestdb(targetb->database());
map2clone->assign(oddbidpair(sourcets->objectid(), targetts->objectid()));
targetts->setname(flagb->getname());
targettst->add(targetts);
flagb->database()->deepcloneobjects(obj2clone, targettst->objectid(), *map2clone);
where
targetb is the target file model space block
attrdef is the attribute definition whose text style is to be retrieved
flagb is the database containing the drawing of the flag
attached you find the three source flag files (ac3, kpa and rkp, created with 2004 lt) and a target file made from scratch, intended to be read from autocad 2006 (odamfc1).
thanks in advance for your help.
mirko pontrelli.
attached files (44.7 kb, 2 views)
(27.0 kb, 2 views)
(29.2 kb, 2 views)
(43.2 kb, 2 views)

deepcloneobjects is intended to be used within the same database. to clone objects between different databases wblockcloneobjects() should be used.
you need not create tablerecord in destination database.
code:
oddbdatabaseptr psourcedb = flagb->database();
oddbdatabaseptr pdestdb = targetb->database();
oddbobjectid idtargettst = pdestdb->gettextstyletableid();
oddbobjectid idsourcets = attrdef->textstyle();
oddbidmappingptr map2clone = oddbidmapping::createobject();
map2clone->setdestdb(pdestdb);
oddbobjectidarray obj2clone;
obj2clone.append(idsourcets);
psourcedb->wblockcloneobjects(obj2clone, idtargettst, *map2clone, cloning_type);
also take care to use appropriate cloning_type defining how duplicate names should be handled.
sergey slezkin

cool. i also tried with wblockcloneobjects without succeeding. i guess i didn't manage because i defined an empty target text style record and tried to copy the source over it.
i should have missed something in the documentation and in the forums; however i thought the difference between the two methods was the shallow/deep types of cloning.
thanks, mr. slezkin.
mirko pontrelli.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】new textstyles in odvectorizee yang686526 DirectDWG 0 2009-05-06 06:28 PM
【转帖】modifying font style settings yang686526 DirectDWG 0 2009-05-06 06:02 PM
【转帖】error c2664 yang686526 DirectDWG 0 2009-05-05 09:34 AM
【转帖】different vectorization of same file on windows and mac yang686526 DirectDWG 0 2009-05-04 07:29 PM
友元((friend) 详解 yogy vc编程 0 2007-05-16 02:20 PM


所有的时间均为北京时间。 现在的时间是 06:49 AM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多