Skip to content

Commit

Permalink
Merge pull request #876 from jdegenstein/tagged_step
Browse files Browse the repository at this point in the history
exporters3d.py -> add "build123d" to exported step files, change step "Name" to build123d label
  • Loading branch information
jdegenstein authored Jan 21, 2025
2 parents cc9f6c6 + 9ce9306 commit 5e6f3b3
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/build123d/exporters3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import OCP.TopAbs as ta
from anytree import PreOrderIter
from OCP.APIHeaderSection import APIHeaderSection_MakeHeader
from OCP.BRepMesh import BRepMesh_IncrementalMesh
from OCP.BRepTools import BRepTools
from OCP.IFSelect import IFSelect_ReturnStatus
Expand All @@ -46,7 +47,7 @@
from OCP.STEPCAFControl import STEPCAFControl_Controller, STEPCAFControl_Writer
from OCP.STEPControl import STEPControl_Controller, STEPControl_StepModelType
from OCP.StlAPI import StlAPI_Writer
from OCP.TCollection import TCollection_AsciiString, TCollection_ExtendedString
from OCP.TCollection import TCollection_AsciiString, TCollection_ExtendedString, TCollection_HAsciiString
from OCP.TColStd import TColStd_IndexedDataMapOfStringString
from OCP.TDataStd import TDataStd_Name
from OCP.TDF import TDF_Label
Expand Down Expand Up @@ -298,16 +299,14 @@ def export_step(
writer.SetLayerMode(True)
writer.SetNameMode(True)

#
# APIHeaderSection doesn't seem to be supported by OCP - TBD
#

# APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model())
# makeHeader.SetName(TCollection_HAsciiString(path))
# makeHeader.SetAuthorValue (1, TCollection_HAsciiString("Volker"));
# makeHeader.SetOrganizationValue (1, TCollection_HAsciiString("myCompanyName"));
# makeHeader.SetOriginatingSystem(TCollection_HAsciiString("myApplicationName"));
# makeHeader.SetDescriptionValue(1, TCollection_HAsciiString("myApplication Model"));
header = APIHeaderSection_MakeHeader(writer.Writer().Model())
if to_export.label:
header.SetName(TCollection_HAsciiString(to_export.label))
# consider using e.g. the non *Value versions instead
# header.SetAuthorValue(1, TCollection_HAsciiString("Volker"));
# header.SetOrganizationValue(1, TCollection_HAsciiString("myCompanyName"));
header.SetOriginatingSystem(TCollection_HAsciiString("build123d"))
# header.SetDescriptionValue(1, TCollection_HAsciiString("myApplication Model"));

STEPCAFControl_Controller.Init_s()
STEPControl_Controller.Init_s()
Expand Down

0 comments on commit 5e6f3b3

Please sign in to comment.