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

yang686526 2009-05-06 11:56 PM

【转帖】problems with oddbdimensionmeasurement90
 
problems with 'oddbdimension::measurement()'
problems with 'oddbdimension::measurement()'
hello. i am using 'oddbdimension::measurement()' and dwgdirect helps says:
"returns the measurement value for this dimension (dxf 42). if object is opened for write then recomputes it, else returns stored one"
but 'oddbdimension::measurement()' does not get the dxf 42; for example i have a linear dimension and it shows 5 (dimension text) its dimlfac is 0.5 and 'oddbdimension::measurement()' gets 10, it should be 5.00. ¿how can i get the dxf 42?
thanks in advance,
william g.s.
last edited by william; 24th august 2004 at 09:32 amfff">. reason: tittle was wrong

could you post the file, please.
in general, dxf 42 (and oddbdimension::measurement(), which returns value loaded from file) should take dimlfac into account. but file can contain incorrect measurement value. in this case this value can be fixed by recomputedimblock() function.
sincerely yours,
george udov
problems with 'oddbdimension::measurement()'
hello george, i send you the file, it is in autocad 2000 format.
'odamfcappdll.exe' shows fine dxf 42 but 'oddbdimension::measurement()' gets another value.
william gs.
attached files (38.8 kb, 4 views)

last edited by william; 26th august 2004 at 07:44 amfff">.

hello, william.
i can't reproduce the problem on either 1.11 or 1.12 pre-release code.
odamfcapp shows 8.3 for dxf 42 of dimension 553e, 16.5 for dimension 5566, 3.5 for dimension 5588. oddbdimension::measurement() returns the same values.
sincerely yours,
george udov
hello george, this is my code:
bool ccpsadminprds::getdimension(const cstring &strhandle, double& ddim)
{
ddim = 0;
if (strhandle.isempty())
return false;
try
{
oddbhandle handle(strhandle);
// requesting objectid
oddbobjectid dimid;
dimid = m_pdwg->getoddbobjectid(handle);
if(!dimid.isvalid())
return false;
oddbdimensionptr dimension = dimid.openobject(oddb::kforwrite);
ddim = dimension->measurement();
return true;
}
catch(...)
{
return false;
}
}
perhaps i am doing something wrong o perhaps i have and old version, how can i see the version of dwgdirect?
thanks a lot,
william gs.

i can't notice anything wrong in code.
the version of dwgdirect you can view in help/about dialog window of odamfcapp sample.
sincerely yours,
george udov


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