From f85fa0325a4e1214dbe19793c533eb43aca640ae Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 11 Jul 2015 14:05:47 +0200 Subject: [PATCH] + write out product name if defined to IGES/STEP files --- src/Mod/Import/App/AppImportPy.cpp | 2 +- src/Mod/Import/Gui/AppImportGuiPy.cpp | 2 +- src/Mod/Part/App/AppPart.cpp | 5 ++++- src/Mod/Part/App/TopoShape.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index edd87a66fe..a3326d1bf5 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -260,7 +260,7 @@ static PyObject * exporter(PyObject *self, PyObject *args) IGESData_GlobalSection header = writer.Model()->GlobalSection(); header.SetAuthorName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.author"))); header.SetCompanyName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.company"))); - //header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); + header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); writer.Model()->SetGlobalSection(header); writer.Transfer(hDoc); Standard_Boolean ret = writer.Write(name8bit.c_str()); diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 941393effc..aa45573e07 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -285,7 +285,7 @@ static PyObject * exporter(PyObject *self, PyObject *args) IGESData_GlobalSection header = writer.Model()->GlobalSection(); header.SetAuthorName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.author"))); header.SetCompanyName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.company"))); - //header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); + header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); writer.Model()->SetGlobalSection(header); writer.Transfer(hDoc); Standard_Boolean ret = writer.Write((const char*)name8bit.c_str()); diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index 39725a29dc..58db653e28 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -340,7 +340,8 @@ void PartExport initPart() 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()); + Interface_Static::SetCVal("write.iges.header.product", hIgesGrp->GetASCII("Product", + Interface_Static::CVal("write.iges.header.product")).c_str()); int unitIges = hIgesGrp->GetInt("Unit", 0); switch (unitIges) { @@ -372,6 +373,8 @@ void PartExport initPart() std::string ap = hStepGrp->GetASCII("Scheme", Interface_Static::CVal("write.step.schema")); Interface_Static::SetCVal("write.step.schema", ap.c_str()); + Interface_Static::SetCVal("write.step.product.name", hStepGrp->GetASCII("Product", + Interface_Static::CVal("write.step.product.name")).c_str()); } } // extern "C" diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index ca76dd5423..4984e26ad1 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -703,7 +703,7 @@ void TopoShape::exportIges(const char *filename) const IGESData_GlobalSection header = aWriter.Model()->GlobalSection(); header.SetAuthorName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.author"))); header.SetCompanyName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.company"))); - //header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); + header.SetSendName(new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); aWriter.Model()->SetGlobalSection(header); aWriter.AddShape(this->_Shape); aWriter.ComputeModel();