几何尺寸与公差论坛------致力于产品几何量公差标准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:51 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】regression on entity colour in ver 1.14

regression on entity colour in ver 1.14 ?
regression on entity colour in ver 1.14 ?
there appears to be a regression in returning the entity colour in 14.1 compared with ver 13. the attached file contains a single dimension where all the dimension entities have a defined colour. however the function
bool isbyaci = entitycolortype.isbyaci ();
returns false in ver 1.14 and true in ver 1.13
when applied to the dimension entities.
regards
gerry
attached files

it's not a regression.
dimension color is "by layer".
objectarx function isbyaci(); returns false for color of this dimension too.
because color method is "by layer", not "by aci".
sincerely yours,
george udov
apologies in advance. i am not an expert in the interpretation of dxf files. to clarify matters (for me) i attach an even simpler file that consists of one dimension in layer '0' with a single line and one text. the line and text entities belong to layer1, and have aci colours 1 and 2 respectively. when i load this file into autocad 2004, the dimension created is in layer1, and the elements have colours 1 and 2.
using the same source code on versions 1.13 and 1.14 i receive different results. when i enquire the layer of the line entity (layername = pentity->layer ()) in 1.13 the function returns layer1. when i enquire entitycolortype.isbyaci () it returns true. these results appear to be consistent with the result i am getting in autocad.
using ver 1.14 pentity->layer() returns '0', and entitycolortype.isbyaci () is false.
when you say "dimension color is by layer", where in the file is this indicated or marked. as layers '0' and 'layer1' both have an aci colour of 7, then it seems that autocad itseld does not consider that this statement is true.
on a more general note if the dimension has a layer ( layer '0' say) and the dimension entities have different layers then how does one whether the layer of the parent is used by its children, or if the children use their own layer.
regards
gerry
attached files (16.1 kb, 3 views)


quote:
using the same source code on versions 1.13 and 1.14 i receive different results. when i enquire the layer of the line entity (layername = pentity->layer ()) in 1.13 the function returns layer1. when i enquire entitycolortype.isbyaci () it returns true. these results appear to be consistent with the result i am getting in autocad.
using ver 1.14 pentity->layer() returns '0', and entitycolortype.isbyaci () is false.
it is strange. pentity->layer() returns 'layer1' for both line and text. dwgdirect 1.14. my code for reproducing issue is
code:
oddbentityptr pent;
pent = pdb->getoddbobjectid(oddbhandle("33")).openobject();
odstring layer = pent->layer();
pent = pdb->getoddbobjectid(oddbhandle("34")).openobject();
layer = pent->layer();
of course, pentity->layer() returns '0' for dimension. it is because dimension lies on layer '0'.
isbyaci is true for line and text, because they colors are assigned by index. isbyaci is false for dimension, because its color is "by layer". when in file it is marked that dimension color is "by layer"? these lines:
code:
0
section
2
entities
0
dimension
5
35
330
1f
100
acdbentity
8
0
100
acdbdimension
dimension's color isn't explicitly indicated, it means that it uses default color. default color is "by layer". you can see it in autocad - open attached file, select the dimension, and you'll see that its layer is '0' and its color is "bylayer".
quote:
on a more general note if the dimension has a layer ( layer '0' say) and the dimension entities have different layers then how does one whether the layer of the parent is used by its children, or if the children use their own layer.
each entity has its own layer. entity properties are handled separately. for example, color are handled this way:
1) if color method is by color or by aci, then entity color is used.
2) if color method is by layer, then layer color is used.
3) if color method is by block, then parent's color is used.
so, for example, if some entity has "byblock" color, and its parent (block reference, dimension, etc) has "bylayer" color, then entity is drawn by color of parent's layer.
sincerely yours,
george udov
the files that i used in 1.13 and 1.14 are not identical. in 1.14 i am also using recomputedimblock () to obtain the measurement. using the arguement of true for this function, then in the code below the layer changes from 'layer1' to '0'. with an arguement of false, the layer remains the same, and the pdim->measurement () returns the correct value.
thanks for your help.
gerry
//line with handle 33
pent = pdb->getoddbobjectid(oddbhandle("33")).openobject();
layer = pent->layer(); //its 'layer1'
//dimension with handle 35
pent = pdb->getoddbobjectid(oddbhandle("35")).openobject();
pent->upgradeopen (); //open for read & write to allow recomputedimblock
pdim = (oddbdimensionptr)pent;
pdim->recomputedimblock (true);
//line with handle 33 again
pent = pdb->getoddbobjectid(oddbhandle("33")).openobject();
layer = pent->layer(); //its now '0'
if you call recomputedimblock with "true". the block is recreated. new line inside dimension block has layer "0"
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】proxy entity question yang686526 DirectDWG 0 2009-05-07 12:04 AM
【转帖】problem during leader entity creation yang686526 DirectDWG 0 2009-05-06 10:40 PM
【转帖】modifiednew objects not updated properly [2.7.1] yang686526 DirectDWG 0 2009-05-06 06:01 PM
【转帖】getting modelspace object pointer for write 9programming te yang686526 DirectDWG 0 2009-05-05 11:30 AM
【转帖】objectarx&dummies教程(十三)—— deriving from acdbentity yang686526 ObjectARX(C++) 0 2009-04-16 10:40 AM


所有的时间均为北京时间。 现在的时间是 01:35 PM.


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