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

yang686526 2009-05-07 05:44 PM

【转帖】unit Of Measuremen
 
unit of measurement
unit of measurement
hello,
i have some problems to read the unit in which the values are stored.
the logic of following code is wrong... but i have no idea why!?
code:
oddbdatabaseptr pdb;
pdb = svcs.readfile( filename, false, false, oda::ksharedenyread );
switch ( pdb->getmeasurement() )
{
case 0: //inch
break;
case 1: //meter
break;
}
how can i read the unit?
last edited by joerg; 21st november 2005 at 07:54 amfff">.
also getinsunits() doesn't return a useable result... because all my demo files return oddb::kunitsundefined. but why?
code:
switch(pdb->getinsunits())
{

case oddb::kunitsinches:
awe_parameter::extrusionheight = extrusionheight / 0.0254;
break;
case oddb::kunitsfeet:
awe_parameter::extrusionheight = extrusionheight / 0.3048;
break;
case oddb::kunitsyards:
awe_parameter::extrusionheight = extrusionheight / 0.9144;
break;
case oddb::kunitsmiles:
awe_parameter::extrusionheight = extrusionheight / 1609.34;
break;
case oddb::kunitsmillimeters:
awe_parameter::extrusionheight = extrusionheight / 0.001;
break;
case oddb::kunitscentimeters:
awe_parameter::extrusionheight = extrusionheight / 0.01;
break;
case oddb::kunitsmeters:
awe_parameter::extrusionheight = extrusionheight / 1;
break;
case oddb::kunitskilometers:
awe_parameter::extrusionheight = extrusionheight / 1000;
break;
}
insunits variable appeared in r15.
measurement - in r13 or r14.
sergey slezkin
quote:
originally posted by sergey slezkin
insunits variable appeared in r15.
measurement - in r13 or r14.
thanks!
it seemed that all my files are unitless... : (


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