Created
March 24, 2020 18:00
-
-
Save jeromerobert/7635e1ff4f209f3862a80b5abbcfd5e2 to your computer and use it in GitHub Desktop.
OpenCASCADE: Set the name of a TopoDS_Shape in a .step file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <STEPControl_Writer.hxx> | |
#include <STEPConstruct.hxx> | |
#include <XSControl_WorkSession.hxx> | |
#include <XSControl_TransferWriter.hxx> | |
#include <StepRepr_RepresentationItem.hxx> | |
#include <TCollection_HAsciiString.hxx> | |
/** Set the name of a TopoDS_Shape in a .step file */ | |
void setName(STEPControl_Writer & writer, const TopoDS_Shape & shape, const char * name) { | |
auto fp = writer.WS()->TransferWriter()->FinderProcess(); | |
auto repr = STEPConstruct::FindEntity(fp, shape); | |
repr->SetName(new TCollection_HAsciiString(name)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment