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

block layer id and its entity layer id
block layer id and its entity layer id
hi all,
opening it with autocad i see the following data: a block which has layer index 0; inside the block there are entities with layer index 2. when i read the file wiht directdwg and use the method oddbentity::layer() i get "0".
is there any way to know the original layer of the entities within the block?
bye
marco
sorry, of course, the beginning of the post has to be:
"i have a dxf file!"
quote:
opening it with autocad i see the following data: a block which has layer index 0;
do you mean block reference?
quote:
when i read the file wiht directdwg and use the method oddbentity::layer() i get "0".
layer() is called for block reference or for entities inside the block?
sergey slezkin
the block reference has layer 2
the layer method is called on entities inside the block reference
could you post (or e-mail me) a sample?
sergey slezkin
here you are
but at which block and block reference should i look at?
sergey slezkin
sorry,
i sent the wrong file. i attach the right one. anyway, it was a my bug: the method layer() of the block reference gives "0" and the method layer of the inner entities gives "2", but i missed to manage the data.
then, i have another question: is there anywhere an information which gives the way to manage the layer name in that case? is it defined anywhere wether to use the block reference layer name or the entities layer name?
hope i understood your question correctly.
if an entity has layer different from default "0" layer - entity's layer is used to render the entity (linetype and color if they are bylayer and layer visibility).
if an entity inside block has default layer "0" - block reference layer is used.
imagine a block which contains a line on "0" layer and a circle on "layer_1"
block reference is on "layer_2".
line will be visible if "layer_2" is visible.
circle will be visible if "layer_1" is visible irrespective of "layer_2" visibility.
sergey slezkin
correct!
thank you
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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



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


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