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

yang686526 2009-05-06 07:35 PM

【转帖】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);


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