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

yang686526 2009-05-06 07:08 PM

【转帖】odavematerial from oddbentity
 
odavematerial from oddbentity
odavematerial from oddbentity
i am trying to determine which odavematerial is relevant to a particular oddbentity and haven't found anything similar to oddbsymutil::islinetypebylayername.
how do i know which ave material goes with an entity?
what i am currently doing, given oddbentityptr "ent", is this:
code:
gam = odavematerial::getattachedmaterial(ent->objectid(), materialid);
if ( ! gam )
gam = odavematerial::getattachedmaterial(ent->layerid(), materialid);

if ( gam && ! materialid.isnull() )
{
do something here with materialid
}is that correct?
i think i would benefit from a sample which clearly demonstrates correct handling of every method for determining colors, materials, and linestyles out there. perhaps it could work off a .dwg file that could also serve as a test case, which i could then use to test my own code.


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