+ customize IGES header

This commit is contained in:
wmayer
2014-10-29 16:39:33 +01:00
parent b6df4a490e
commit 76906d20a0
6 changed files with 70 additions and 30 deletions

View File

@@ -284,14 +284,20 @@ void PartExport initPart()
IGESControl_Controller::Init();
STEPControl_Controller::Init();
// set the user-defined units
// set the user-defined settings
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part");
int value = Interface_Static::IVal("write.iges.brep.mode");
bool brep = hGrp->GetBool("BrepMode", value > 0);
Interface_Static::SetIVal("write.iges.brep.mode",brep ? 1 : 0);
int unitIges = hGrp->GetInt("UnitIges", 0);
//IGES handling
Base::Reference<ParameterGrp> hIgesGrp = hGrp->GetGroup("IGES");
int value = Interface_Static::IVal("write.iges.brep.mode");
bool brep = hIgesGrp->GetBool("BrepMode", value > 0);
Interface_Static::SetIVal("write.iges.brep.mode",brep ? 1 : 0);
Interface_Static::SetCVal("write.iges.header.company", hIgesGrp->GetASCII("Company").c_str());
Interface_Static::SetCVal("write.iges.header.author", hIgesGrp->GetASCII("Author").c_str());
//Interface_Static::SetCVal("write.iges.header.product", hIgesGrp->GetASCII("Product").c_str());
int unitIges = hIgesGrp->GetInt("Unit", 0);
switch (unitIges) {
case 1:
Interface_Static::SetCVal("write.iges.unit","M");
@@ -304,7 +310,9 @@ void PartExport initPart()
break;
}
int unitStep = hGrp->GetInt("UnitStep", 0);
//STEP handling
Base::Reference<ParameterGrp> hStepGrp = hGrp->GetGroup("STEP");
int unitStep = hStepGrp->GetInt("Unit", 0);
switch (unitStep) {
case 1:
Interface_Static::SetCVal("write.step.unit","M");