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

yang686526 2009-05-06 07:48 PM

【转帖】oddbhatchsetpixelsize90 and oddbhatchsetassociative90
 
oddbhatch::setpixelsize() and oddbhatch::setassociative()...
oddbhatch::setpixelsize() and oddbhatch::setassociative()......
i found that the associative of hatch is always "no" though i have set it true by phatch->setassociative(true);
also ,the pixelsize of hatch is always zero though i have setpixelsize(2.85);
the follow is my codes:
oddbhatchptr phatch = oddbhatch::createobject();
block_table->appendoddbentity(phatch);
// set the hatch properties.
phatch->setassociative(true);
phatch->setpixelsize(2.85);
phatch->setpattern(oddbhatch::kpredefined, hatch->get_hatchtype()->name().ascii());
phatch->sethatchstyle(oddbhatch::knormal);
phatch->setpatternangle(hatch->get_hatchtype()->savedwg_angle());
phatch->setpatternscale(hatch->get_hatchtype()->savedwg_scale());
your example code does not contain loops creating.
pixel size is saved to file only if one of hatch loops has kderived bit set in loop type.
you can find sample of creating associative hatch in odwriteex example. (you need specify objectids of associated entities for each loop by setassocobjidsat() or create a loop from objids array - appendloop(looptype, objidsarray)
sergey slezkin


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