几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】oddbentitysetlayer with undefined layers (http://www.dimcax.com/hust/showthread.php?t=17523)

yang686526 2009-05-06 07:41 PM

【转帖】oddbentitysetlayer with undefined layers
 
oddbentity::setlayer with undefined layers
oddbentity::setlayer with undefined layers
how is oddbentity::setlayer(const odstring& newval, bool dosubents = true) and similar entity functions defined to behave when "newval" has the name of an undefined layer:
a) establish a layer with default values of that name and set entity layer to the new layer entry.
b) treat it as an error and leave entitity layer unchanged.
either way will do, but the choise has consquences for implementation.
-rune jorgensen
www.dds.no
i think dwgdirect is designed to throw oderror() exceptions when there are invalid data and is supposed to leave the state of the objects (in this case both entities and layers) unchanged.
i don't know whether it is the same with this very function, you should try it yourself?
best regards
chudomir


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