查看单个帖子
旧 2009-05-04, 06:45 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)