IGES & STEP length units

hi,

is it possible to find out the length units of iges and step files?

best regards,
adrian

a-helcman's picture

iges:
IGESControl_Reader o_iges_reader;
o_iges_reader.ReadFile(s_file_name);
DeclareAndCast (IGESData_IGESModel, po_model, o_iges_reader.Model());
if (po_model->GlobalSection().UnitValue() == 25.4)
{
//INCHES
}

step:
STEPControl_Reader o_step_reader;
o_step_reader.ReadFile (s_file_name);
DeclareAndCast (StepData_StepModel, po_model, o_step_reader.Model());

for (int i = 1; i < po_model->NbEntities(); i++)
{
if (po_model->Entity(i)->IsKind (STANDARD_TYPE(StepBasic_LengthMeasureWithUnit)))
{
DeclareAndCast (StepBasic_LengthMeasureWithUnit, po_lmwu, po_model->Entity(i));

if (po_lmwu->ValueComponent() == 25.4)
{
//INCHES
}
break;
}
}