查看单个帖子
旧 2009-05-06, 07:35 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】oddbdimension issue

oddbdimension issue
oddbdimension issue
i'm trying to use a temporary dimension entity to draw a sample for a dimensioning tool. if i call recomputedimblock after adding it to the database it works. however if i haven't added it then it crashes. i'd like to only add it to the database on (successful) completion of the tool. suggestions?
george,
i am calling the setdatabasedefaults after creating my temporary entity. i've attached my code for the creation of the aligned dim object on a mouse click.
code:
m_pt0=m_pt1=pt;
m_pnewaligneddim=oddbaligneddimension::createobject();
m_pnewaligneddim->setdatabasedefaults(pvw->database());
m_pnewaligneddim->setnormal(getviewingdirection());
m_pnewaligneddim->setdimensiontext("yada");
m_pnewaligneddim->setdimensionstyle(pvw->database()->getdimstylestandardid());
odgepoint3d start, end;
pvw->getworldstartendpoints(start, end,m_pt0,m_pt1);
m_pnewaligneddim->setxline1point(start);
m_pnewaligneddim->setxline2point(end);
m_pnewaligneddim->setdimlinepoint(end);
m_pnewaligneddim->usedefaulttextposition();
//crashes here!!!!
m_pnewaligneddim->recomputedimblock();

pvw->overlapdraw(m_pnewaligneddim);
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)