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

yang686526 2009-05-04 06:45 PM

【转帖】creating a block with attribute texts
 
creating a block with attribute texts ??
creating a block with attribute texts ??
hi !!
i have create serveral blocks with graphics and texts !! now i want to define the texts (oddbmtext) as attributedefinition instead so they can be modify in autocad !! how do i add attributedefinitions correctly to my existing blocks - example below does not work correctly !!
oddbattributedefinitionptr pattdef = oddbattributedefinition::createobject();
pblock->appendoddbentity(pattdef);
pattdef->setprompt("value");
pattdef->settag("article");
pattdef->setheight(bheight);
pattdef->settextstring(btextstring);
pattdef->setverticalmode(oddb::ktextbottom);
pattdef->setrotation(odatoradian(0));
pattdef->setlinespacingfactor(2);
pattdef->setcolor(bcolor);
pattdef->setlayer(blayername, false);
pattdef->setlineweight(getlineweight(bpenwidth));
regards
soeren
your code should be enough if you insert your block in autocad. it should prompt for attribute values.
if you insert references to your block in your program (oddbblockreference) don't forget to append oddbattributes to oddbblockreference
sergey slezkin


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