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

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】from oddbstub to layer number (http://www.dimcax.com/hust/showthread.php?t=16348)

yang686526 2009-05-05 11:08 AM

【转帖】from oddbstub to layer number
 
from oddbstub* to layer number
from oddbstub* to layer number
ok, i must be missing something stupid, but how does one convert from oddbstub*layer to an actual layer number?
oddbstub is internal dd structure and it is not defined in public headers. probably you mean oddbobjectid?
having layer id you can get pointer to oddblayer:
code:
oddbobjectid idlayer = ...;
oddblayerptr player = idlayer.openobject();
sergey slezkin
ok, i will explain better:
i am trying to use the odgisubentitytraitsdata class. i can access color and line weight with no problem, but layer() returns a oddbstub*. i don't know what to do with that. am i trying to use effectivetraits wrong?
you can assign the oddbstub* result to a oddbobjectid and then you can open the layer:
oddbstub* pstub = traits.layer();
oddbobjectid idlayer(pstub);
oddblayertablerecordptr player = idlayer.safeopenobject(...);
...
or shorter:
oddblayertablerecordptr player = oddbobjectid(traits.layer()).safeopenobject();
hope this helps
best regards
chudomir
thanks, that worked perfectly.
scott


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