Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exporters3d.py -> add "build123d" to exported step files, change step "Name" to build123d label #876

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading