DATAKIT API  V2025.4
Step Write Functions

Exported APIs for STEP Write Library. More...

Functions

 SetAsDeprecated ("2025.4", "Use stepw_Add3DModelDisplay and stepw_AddReference instead.") Dtk_ErrorStatus stepw_Add3DFdtModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay
 Adds a view ( Dtk_ModelDisplay ) with a link to a FDT, in the current part context. More...
 
Dtk_ErrorStatus stepw_Add3DModelDisplay (const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
 Adds a view ( Dtk_ModelDisplay ) in the current part context. More...
 
DtkErrorStatus stepw_Add3DPartFDT (const Dtk_FdtPtr &inFDT)
 Adds a FDT in the current part context. More...
 
DtkErrorStatus stepw_Add3DPartFDT (const Dtk_FdtPtr &inFDT, const Dtk_FdtPtr &inFDTGraf)
 Adds a FDT in the current part context, with a predefined graphic presentation. More...
 
DtkErrorStatus stepw_Add3DPartFDT (const Dtk_FdtPtr &inFDT, const stepw_ER &inER)
 Adds a FDT in the current part context, with an element reference (usually the target geometry). More...
 
Dtk_ErrorStatus stepw_Add3DPartProperty (const Dtk_MetaDataPtr &inProperty)
 Adds a roperty to a part (default), or to an entity, according to InitPropertySet mode. More...
 
Dtk_ErrorStatus stepw_AddAnchorItem (const int inEntityID, const int inProductID, const Dtk_string &inGUID)
 Registers an entity in the ANCHOR section, with an assigned GUID (optional). More...
 
Dtk_ErrorStatus stepw_AddExternalReference (const Dtk_string &inProductName, const Dtk_string &inFileName, int &outID, Dtk_ID inInstCompId=0)
 Declares a product to be written as an external reference (separated file). More...
 
DtkErrorStatus stepw_AddInstance (const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
 Adds an instance of a product ( child ) in an assembly product ( father ). More...
 
DtkErrorStatus stepw_AddInstanceToPath (stepw_ERP &inOutElementReferencePath, const int inInstanceID)
 Appends an instance identifier to the element reference path. The instance identifier is provided by this library. More...
 
DtkErrorStatus stepw_AddInstanceWithInfo (const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
 Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes. More...
 
DtkErrorStatus stepw_AddInstanceWithInfo (const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo, int &outInstanceID, const int inInstanceUserID=0, const Dtk_string &inReferenceDesignator="")
 Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes. More...
 
Dtk_ErrorStatus stepw_AddOverrideInstanceInfo (stepw_ERP &inElementReferencePath, Dtk_InfoPtr &inOverrideInfo)
 Assigns information on an instance in multi-level assembly context. More...
 
DtkErrorStatus stepw_AddReference (stepw_ER &inElementReference)
 Registers the previously created element reference in the writer. More...
 
int stepw_AnchorProductID (const int inUserID)
 Finds the product having an ANCHOR section, by user identifier. More...
 
DtkErrorStatus stepw_CreateInstancePath (stepw_ERP &inOutElementReferencePath)
 Initializes a path for the element reference, identifying the sequence of instances to pass through. More...
 
DtkErrorStatus stepw_CreateReference (stepw_ER &inOutElementReference, const int inEntityID, const int inProductID=0, const char *inReferenceKind="")
 Creates a reference to an entity located in the designated Product/Part context, or current context if not specified. More...
 
DtkErrorStatus stepw_CreateReferenceToFdt (stepw_ER &inOutElementReference, const int inEntityID, const int inProductID)
 Creates a reference to an entity located in the designated Product/Part context. The reference target is known to be an FDT (Dtk_FDT). More...
 
DtkErrorStatus stepw_CreateReferenceToGroup (stepw_ER &inOutElementReference, const int inEntityID, const int inProductID)
 Creates a reference to an entity located in the designated Product/Part context. The reference target is known to be a feature (Dtk_Feature) (interpreted as a group of geometries). More...
 
DtkErrorStatus stepw_CreateReferenceToNode (stepw_ER &inOutElementReference, const int inNodeID, const int inProductID=0, const char *inReferenceKind="")
 Creates a reference to a whole node (Dtk_Node), located in the designated Product/Part context. More...
 
Dtk_ErrorStatus stepw_DefineInstancePath (stepw_ERP &inOutElementReferencePath, const Dtk_tab< Dtk_ID > &inInstancePath, const bool unused=false)
 Define the whole instance identifier sequence of the element reference path. More...
 
DtkErrorStatus stepw_End3DPart ()
 Ends the writing of a product 3D part. More...
 
DtkErrorStatus stepw_EndFile ()
 Ends the writing of the current STEP file. More...
 
void stepw_EndNodeContext (const int unused=0)
 Ends current node context. More...
 
DtkErrorStatus stepw_EndProduct (const int inProductID)
 Ends the writing of a product - calls WriteAssemblyInstances if not yet done. More...
 
Dtk_string stepw_GiveUniqueFileName (const Dtk_string &inFileName)
 Creates a unique file name for an external reference - applies to the current session (stepw_InitFile to stepw_EndFile). More...
 
Dtk_string stepw_GiveUniqueProductName (const Dtk_string &inProductName)
 Creates a unique product name. More...
 
DtkErrorStatus stepw_Init3DPart (const int inProductID)
 Initializes the writing of a 3D part for the designated product. More...
 
DtkErrorStatus stepw_InitFile (const Dtk_string &inFileName, const char *inOriginatingSystem=" user ", const int inSchema=0)
 Initializes a file to be written. More...
 
void stepw_InitNodeContext (const int inNodeID)
 Initializes the context to write entities in a node. More...
 
void stepw_InitNodeContext (const int inNodeID, const Dtk_InfoPtr &inNodeInfo)
 Initializes the context to write entities in a node. More...
 
DtkErrorStatus stepw_InitProduct (const Dtk_string &inProductName, int &outAssignedID, Dtk_ID inProductUserID=0)
 Initializes the definition context of a product. More...
 
Dtk_ErrorStatus stepw_InitPropertySet (const int inMode)
 Sets attachment mode for next property writing : the whole Part, or to the following entity to be written. More...
 
DtkErrorStatus stepw_SetAnchorProduct (const int inProductID, const int inUserID)
 Declares the product as having an ANCHOR section. If the designated product is already declared as such, sets its user-defined identifier. More...
 
Dtk_ErrorStatus stepw_SetContextTolerance (const double inTol)
 Sets length tolerance for the 3D geometry (uncertainty). More...
 
Dtk_ErrorStatus stepw_SetContextUnit (const int inLength, const int inAngle=0)
 Sets file units in which the geometries, properties are to be written. More...
 
Dtk_ErrorStatus stepw_SetConversionLengthUnit (const int inLength)
 Sets file units in which the geometries, properties are to be written, and apply the conversion factor (from MM). More...
 
DtkErrorStatus stepw_SetHeaderData (const int inNumItem, const Dtk_string &inValItem)
 Sets STEP file header fields value. More...
 
DtkErrorStatus stepw_SetHeaderData (const int inNumItem, const wchar_t *inValItem)
 Sets STEP file header fields value. More...
 
DtkErrorStatus stepw_SetInstanceUserID (const int inInstanceID, const int inInstanceUserID)
 Sets the designated instance its user-defined identifier. More...
 
DtkErrorStatus stepw_SetModeCompress (const int inMode)
 Selects a mode of writing compact or compressed step files. More...
 
DtkErrorStatus stepw_SetModeFdt (const int inMode, const int inPolyline=2)
 Activates/Deactivates writing of FDT. More...
 
DtkErrorStatus stepw_SetModeInfoFirstFace (bool inModeInfoFirstFace)
 On a solid or shell, allows the spreading of its first available face graphical attributes to the whole solid/shell. More...
 
DtkErrorStatus stepw_SetModeItemName (const int inMode)
 Selects a mode for topological 3D items naming policy (shells, faces, edges ). More...
 
DtkErrorStatus stepw_SetModeProp (const int inMode)
 Activates/Deactivates writing of properties : User Attributes, Product Data. More...
 
DtkErrorStatus stepw_SetPartProperties (const Dtk_InfoPtr &inInfo, const int inItem)
 Defines properties to be attached directly to the product : considers the list of Dtk_Val in the Dtk_Info. More...
 
DtkErrorStatus stepw_SetProductLayerInfosSet (const Dtk_LayerInfosSetPtr inLayerInfoSet)
 Sets the LayerInfosSet to refer to when writing the current product. It uses its mapping between layer identifier and name. More...
 
DtkErrorStatus stepw_SetReferencePath (stepw_ER &inOutElementReference, stepw_ERP &inElementReferencePath)
 Assigns the element reference path to the element reference. More...
 
int stepw_WhichInstanceID (const int inUserID)
 Checks if an instance (known by its user-defined identifier), is already registered. More...
 
int stepw_WhichProductID (const Dtk_string &inProductName)
 Checks if a product (known by its unique name), is already registered. More...
 
DtkErrorStatus stepw_Write3DAxisSystem (const Dtk_AxisSystemPtr &inAxis)
 Writes an axis system of a 3D part, in STEP, it is a construction geometry based on an axis placement. More...
 
DtkErrorStatus stepw_Write3DConstructionGeometry (const Dtk_BodyPtr &inBody)
 Writes a body as a construction geometry of a 3D part, of any kind (solid, shell / faces, wireframe / points). More...
 
DtkErrorStatus stepw_Write3DPartBody (const Dtk_BodyPtr &inBody)
 Writes a body of a 3D part (3D content of a product), of any kind (solid, shell / faces, wireframe / points). More...
 
DtkErrorStatus stepw_Write3DPartBodyWithMesh (const Dtk_BodyPtr &inBody, const Dtk_MeshPtr &inMesh, const int inMode=0)
 Writes a body of a 3D part (3D content of a product), associated with a mesh. More...
 
DtkErrorStatus stepw_Write3DPartMesh (const Dtk_MeshPtr &inMesh)
 Writes a mesh of a 3D part (3D content of a product). More...
 
DtkErrorStatus stepw_Write3DPartMeshFromBody (const Dtk_MeshPtr &inMesh, const Dtk_BodyPtr &inBody)
 Writes a mesh of a 3D part (3D content of a product), coming from a body, without writing the body itself. More...
 
DtkErrorStatus stepw_WriteAssemblyInstances (const int inID)
 Writes instances detained by a product. More...
 
Dtk_ErrorStatus stepw_WriteExternalReference (const int inID)
 Writes a product as an external reference. Only one per file for a given product. More...
 

Detailed Description

Exported APIs for STEP Write Library.

Function Documentation

◆ SetAsDeprecated()

SetAsDeprecated ( "2025.4"  ,
"Use stepw_Add3DModelDisplay and stepw_AddReference instead."   
) const &

Adds a view ( Dtk_ModelDisplay ) with a link to a FDT, in the current part context.

Can be called at any time between stepw_Init3DPart and stepw_End3DPart - writing takes place after the bodies. A same FDT can be used in several views.

Warning
stepw_Add3dPartFDT call is required, here only the link with the view/model_display is recorded.
Remarks
There is no required order between Add3dPartFDT and Add3dFdtModelDisplay.
Parameters
[in]inModelDisplay: the view to be written with the 3D Part.
[in]inFDT: the FDT to be linked to the view.
Returns
dtkNoError : the view and link have been correctly added.
dtkErrorNullPointer : inModelDisplay or inFDT is null.
dtkErrorLicence : no licence active or stepw_SetModeFdt not called before starting.
Deprecated:
Use stepw_Add3DModelDisplay and stepw_AddReference instead.

◆ stepw_Add3DModelDisplay()

Dtk_ErrorStatus stepw_Add3DModelDisplay ( const Dtk_ModelDisplayPtr inModelDisplay,
const int  inMode 
)

Adds a view ( Dtk_ModelDisplay ) in the current part context.

Can be called at any time between stepw_Init3DPart and stepw_End3DPar, writing takes place after the bodies.

Parameters
[in]inModelDisplay: the view to be written with the 3D Part.
[in]inMode: 0 no FDT/Annotation is attached to the view (default), 1 all FDT/Annotations are attached to the view.
Returns
dtkNoError : the view has been correctly added.
dtkErrorNullPointer : inModelDisplay is null.
dtkErrorLicence : no licence active or stepw_SetModeFdt not called before starting.

◆ stepw_Add3DPartFDT() [1/3]

DtkErrorStatus stepw_Add3DPartFDT ( const Dtk_FdtPtr inFDT)

Adds a FDT in the current part context.

Can be called at any time between stepw_Init3DPart and stepw_End3DPart, writing takes place after the bodies.

Parameters
[in]inFDT: the FDT to be written with the 3D part (according to ModeFdt, as semantic and/or graphic).
Returns
dtkNoError : the FDT has been correctly added.
dtkErrorNotProcessed : inFDT is null.
dtkErrorLicence : no licence active or stepw_SetModeFdt not called before starting.

◆ stepw_Add3DPartFDT() [2/3]

DtkErrorStatus stepw_Add3DPartFDT ( const Dtk_FdtPtr inFDT,
const Dtk_FdtPtr inFDTGraf 
)

Adds a FDT in the current part context, with a predefined graphic presentation.

Can be called at any time between stepw_Init3DPart and stepw_End3DPart, writing takes place after the bodies.

Parameters
[in]inFDT: the FDT to be written as semantic data with the 3D part.
[in]inFDT: the FDT to be used for graphical presentation with the 3D part.
Returns
dtkNoError : the FDT has been correctly added.
dtkErrorNotProcessed : inFDT is null.
dtkErrorLicence : no licence active or stepw_SetModeFdt not called before starting.

◆ stepw_Add3DPartFDT() [3/3]

DtkErrorStatus stepw_Add3DPartFDT ( const Dtk_FdtPtr inFDT,
const stepw_ER inER 
)

Adds a FDT in the current part context, with an element reference (usually the target geometry).

See also
stepw_CreateReference
Parameters
[in]inFDT: the FDT to be written with the 3D part (according to ModeFdt, as semantic and/or graphic).
[in]inER: the element reference allowing the FDT to target entities (usually geometries).
Returns
dtkNoError : the FDT and its element reference have been correctly added.
dtkErrorNotProcessed : inFDT is null.
dtkErrorLicence : no licence active or stepw_SetModeFdt not called before starting.

◆ stepw_Add3DPartProperty()

Dtk_ErrorStatus stepw_Add3DPartProperty ( const Dtk_MetaDataPtr inProperty)

Adds a roperty to a part (default), or to an entity, according to InitPropertySet mode.

Properties on the whole part can represent either "Product Data" or a property of any kind. "Product Data" are predefined properties, their reserved titles are : "Part Number", "Nomenclature", "Description", "Definition", "Revision", "Document" or "Source". All are optional (when absent, a default value is set), required to be TEXT, "Source" must take these values : "MADE" or "BOUGHT" otherwise it is ignored. Entity properties will be attached to the next written entity, so, to be called before writing the entity of attachment. Entities eligible for properties as metadata are : Dtk_Body, Dtk_Mesh.

Parameters
[in]inProperty: the MetaData to be written with the 3D Part.
Returns
dtkNoError : the property has been correctly added.
dtkErrorNullPointer : inProperty is null.

◆ stepw_AddAnchorItem()

Dtk_ErrorStatus stepw_AddAnchorItem ( const int  inEntityID,
const int  inProductID,
const Dtk_string inGUID 
)

Registers an entity in the ANCHOR section, with an assigned GUID (optional).

Entities declared in the ANCHOR section can be referenced from outside of the product file, in cases where this product is written in a separated file. If the designated product is not yet declared as having an ANCHOR section, it calls stepw_SetAnchorProduct.

See also
stepw_SetAnchorProduct
Parameters
[in]inEntityID: identifier of the entity to declare in the ANCHOR section.
[in]inProductID: identifier of the product where to declare entities in the ANCHOR section.
[in]inGUID: the GUID to assign to the entity.
Returns
dtkNoError : the entity has been correctly declared in the ANCHOR section.
dtkErrorUnspecified : the product identifier does not identify a product in the current file.
dtkErrorNotProcessed : the entity is already registered with a different GUID.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_AddExternalReference()

Dtk_ErrorStatus stepw_AddExternalReference ( const Dtk_string inProductName,
const Dtk_string inFileName,
int &  outID,
Dtk_ID  inInstCompId = 0 
)

Declares a product to be written as an external reference (separated file).

Parameters
[in]inProductName: name of product to be referenced externally.
[in]inFileName: name of file in which its content will be written.
[out]outID: returned unique identifier for a product. To be used in other calls to identify it.
[in]inInstCompID: optional, defines a user identifier for this product. If a sequence stepw_InitProduct - stepw_EndProduct is then called with outID identifier, it automatically produces another file, with that name, in the same path as the master file.

An external reference is written in the current file (only one per file) if this product is used in an instance or if WriteExternalReference is explicitly called.

Warning
Must be called before first use or first call to InitProduct.. or WriteExternalReference for this product.
Returns
dtkNoError if the product was correctly registered as an external reference.
dtkErrorUnspecified if product already written not as external reference.

◆ stepw_AddInstance()

DtkErrorStatus stepw_AddInstance ( const int  inFatherProductID,
const int  inChildProductID,
const Dtk_transfo inPosition,
const Dtk_string inInstanceName 
)

Adds an instance of a product ( child ) in an assembly product ( father ).

Parameters
[in]inFatherProductID: unique identifier of the father product, provided by stepw_InitProduct.
[in]inChildProductID: unique identifier of the child product, provided by stepw_InitProduct.
[in]inPosition: the relative position of the child product instance, in the father product.
[in]inInstanceName: name to be assigned to the instance.
Returns
dtkNoError instance has been correctly added.
dtkErrorUnspecified : the child product do not exist yet (so the instance is not registered).

◆ stepw_AddInstanceToPath()

DtkErrorStatus stepw_AddInstanceToPath ( stepw_ERP inOutElementReferencePath,
const int  inInstanceID 
)

Appends an instance identifier to the element reference path. The instance identifier is provided by this library.

When in the context of an assembly with more than one depth level, to designates the instance of a part/product located at a deeper level, there is a need to identify all of the part/product instances we pass through.

Parameters
[in,out]inOutElementReferencePath: object representing the reference path, that will be used internally.
[in]inInstanceID: identifier of an instance to append to the element reference path.
See also
stepw_AddInstanceWithInfo
Returns
dtkNoError : the instance identifier has been appended to the element reference path.
dtkErrorUnspecified : content of inOutElementReferencePath is empty or instance identifier is invalid (does not identify a previously registered instance).
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_AddInstanceWithInfo() [1/2]

DtkErrorStatus stepw_AddInstanceWithInfo ( const int  inFatherProductID,
const int  inChildProductID,
const Dtk_transfo inPosition,
const Dtk_string inInstanceName,
const Dtk_InfoPtr inInstanceInfo 
)

Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes.

Parameters
[in]inFatherProductID: unique identifier of the father product, provided by stepw_InitProduct.
[in]inChildProductID: unique identifier of the child product, provided by stepw_InitProduct.
[in]inPosition: the relative position of the child product instance, in the father product.
[in]inInstanceName: name to be assigned to the instance.
[in]inInstanceInfo: set of information to be attached to the instance, contains attributes (Dtk_Val).
Returns
dtkNoError instance has been correctly added.
dtkErrorUnspecified : the child product do not exist yet (so the instance is not registered).

◆ stepw_AddInstanceWithInfo() [2/2]

DtkErrorStatus stepw_AddInstanceWithInfo ( const int  inFatherProductID,
const int  inChildProductID,
const Dtk_transfo inPosition,
const Dtk_string inInstanceName,
const Dtk_InfoPtr inInstanceInfo,
int &  outInstanceID,
const int  inInstanceUserID = 0,
const Dtk_string inReferenceDesignator = "" 
)

Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes.

Parameters
[in]inFatherProductID: unique identifier of the father product, provided by stepw_InitProduct.
[in]inChildProductID: unique identifier of the child product, provided by stepw_InitProduct.
[in]inPosition: the relative position of the child product instance, in the father product.
[in]inInstanceName: name to be assigned to the instance.
[in]inInstanceInfo: set of information attached to the instance, contains attributes (Dtk_Val).
[out]outInstanceID: the assigned identifier to the created instance.
[in]inInstanceUserID: optional, the identifier the user wants to provide to the instance, that will be use in addition to the one assigned by this library.
[in]inReferenceDesignator: optional, additional name identification field for the instance.
Returns
dtkNoError instance has been correctly added.
dtkErrorUnspecified : the child product do not exist yet (so the instance is not registered).

◆ stepw_AddOverrideInstanceInfo()

Dtk_ErrorStatus stepw_AddOverrideInstanceInfo ( stepw_ERP inElementReferencePath,
Dtk_InfoPtr inOverrideInfo 
)

Assigns information on an instance in multi-level assembly context.

The first identifier of the route designating the instance allows to deduce in which assembly context the instance will hold the information. This produces the writing of a CONTEXT_DEPENDENT_OVERRIDING_STYLED_ITEM.

Parameters
[in]inElementReferencePath: the instance route to designate the instance in the assembly.
[in]inOverrideInfo: the information to apply to this instance. Only color and blanked status are taken into account.
See also
stepw_CreateInstancePath
Returns
dtkNoError : the override information has been correctly assigned to the instance.
dtkErrorUnspecified : inOutElementReference content is empty.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_AddReference()

DtkErrorStatus stepw_AddReference ( stepw_ER inElementReference)

Registers the previously created element reference in the writer.

Parameters
[in]inElementReference: object representing the reference, that will be used internally.
Returns
dtkNoError : content of inElementReference has been filled.
dtkErrorUnspecified : content of inElementReference is empty.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_AnchorProductID()

int stepw_AnchorProductID ( const int  inUserID)

Finds the product having an ANCHOR section, by user identifier.

Parameters
[in]inUserID: identifier the user previously provided to identify the product.
See also
stepw_SetAnchorProduct
Returns
0 : the product hasn't been found.
positive value : the found product corresponding identifier (non-user defined)

◆ stepw_CreateInstancePath()

DtkErrorStatus stepw_CreateInstancePath ( stepw_ERP inOutElementReferencePath)

Initializes a path for the element reference, identifying the sequence of instances to pass through.

When in the context of an assembly with more than one depth level, to designates the instance of a part/product located at a deeper level, there is a need to identify all of the part/product instances we pass through.

Parameters
[in,out]inOutElementReferencePath: object representing the reference path, that will be used internally.
See also
stepw_AddInstanceWithInfo
Returns
dtkNoError : inOutElementReferencePath has been initialized.
dtkErrorUnspecified : content of inOutElementReferencePath has not been initialized, allocation issue.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_CreateReference()

DtkErrorStatus stepw_CreateReference ( stepw_ER inOutElementReference,
const int  inEntityID,
const int  inProductID = 0,
const char *  inReferenceKind = "" 
)

Creates a reference to an entity located in the designated Product/Part context, or current context if not specified.

Parameters
[in,out]inOutElementReference: object representing the reference, that will be used internally.
[in]inEntityID: identifier of a Dtk_Entity that will be referenced in current Product/Part.
[in]inProductID: identifier of the Product in which the entity is located. If equals 0, the current Product/Part context is used.
[in]inReferenceKind: Optional, character sequence to specify the reason of the reference. Supported sequences are "fdt", "group", "visible", "hidden". "fdt" allows to specify that the target of the reference is a FDT entity (Dtk_Fdt). "group" allows to specify that the target of the reference is a feature (interpreted as a group of geometries) (Dtk_Feature). "visible" allows to specify that the target should be visible in the designated Product/Part context. "hidden" allows to specify that the target should be hidden in the designated Product/Part context.
See also
stepw_CreateReferenceToFdt
stepw_CreateReferenceToGroup
Returns
dtkNoError : content of inOutElementReference has been filled.
dtkErrorUnspecified : content of inOutElementReference has not been filled, allocation issue or unrecognized character sequence in case the reference reason has been specified.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_CreateReferenceToFdt()

DtkErrorStatus stepw_CreateReferenceToFdt ( stepw_ER inOutElementReference,
const int  inEntityID,
const int  inProductID 
)

Creates a reference to an entity located in the designated Product/Part context. The reference target is known to be an FDT (Dtk_FDT).

Parameters
[in,out]inOutElementReference: object representing the reference, that will be used internally.
[in]inEntityID: identifier of a Dtk_Entity that will be referenced in current Product/Part (is an FDT).
[in]inProductID: identifier of the Product in which the entity is located. If equals 0, the current Product/Part context is used.
Remarks
Same as stepw_CreateReference( inOutElementReference, inEntityID, inProductID, "fdt" ).
Returns
dtkNoError : content of inOutElementReference has been filled.
dtkErrorUnspecified : content of inOutElementReference has not been filled, allocation issue.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_CreateReferenceToGroup()

DtkErrorStatus stepw_CreateReferenceToGroup ( stepw_ER inOutElementReference,
const int  inEntityID,
const int  inProductID 
)

Creates a reference to an entity located in the designated Product/Part context. The reference target is known to be a feature (Dtk_Feature) (interpreted as a group of geometries).

Parameters
[in,out]inOutElementReference: object representing the reference, that will be used internally.
[in]inEntityID: identifier of a Dtk_Entity that will be referenced in current Product/Part (is a feature).
[in]inProductID: identifier of the Product in which the entity is located. If equals 0, the current Product/Part context is used.
Remarks
Same as stepw_CreateReference( inOutElementReference, inEntityID, inProductID, "group" ).
Returns
dtkNoError : content of inOutElementReference has been filled.
dtkErrorUnspecified : content of inOutElementReference has not been filled, allocation issue.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_CreateReferenceToNode()

DtkErrorStatus stepw_CreateReferenceToNode ( stepw_ER inOutElementReference,
const int  inNodeID,
const int  inProductID = 0,
const char *  inReferenceKind = "" 
)

Creates a reference to a whole node (Dtk_Node), located in the designated Product/Part context.

Parameters
[in,out]inOutElementReference: object representing the reference, that will be used internally.
[in]inNodeID: identifier of a Dtk_Node that will be referenced in current Product/Part context.
[in]inProductID: identifier of the Product in which the entity is located. If equals 0, the current Product/Part context is used.
[in]inReferenceKind: Optional, character sequence to specify the reason of the reference. Supported sequences are "fdt", "group", "visible", "hidden". "fdt" allows to specify that the target of the reference is a node that contains a FDT (Dtk_Node, Dtk_Fdt). "group" allows to specify that the target of the reference is a node that contains a feature (interpreted as a group of geometries) (Dtk_Node, Dtk_Feature). "visible" allows to specify that the target should be visible in the designated Product/Part context. "hidden" allows to specify that the target should be hidden in the designated Product/Part context.
Returns
dtkNoError : content of inOutElementReference has been filled.
dtkErrorUnspecified : content of inOutElementReference has not been filled, allocation issue or unrecognized character sequence in case the reference reason has been specified.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_DefineInstancePath()

Dtk_ErrorStatus stepw_DefineInstancePath ( stepw_ERP inOutElementReferencePath,
const Dtk_tab< Dtk_ID > &  inInstancePath,
const bool  unused = false 
)

Define the whole instance identifier sequence of the element reference path.

When in the context of an assembly with more than one depth level, to designates the instance of a part/product located at a deeper level, there is a need to identify all of the part/product instances we pass through.

Parameters
[in,out]inOutElementReferencePath: object representing the reference path, that will be used internally.
[in]inInstancePath: sequence of instance identifiers to define for the element reference path.
Returns
dtkNoError : the sequence of instance identifiers has been set for the element reference path.
dtkErrorUnspecified : the sequence of instance identifiers is invalid (does not identify previously registered instances).
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_End3DPart()

DtkErrorStatus stepw_End3DPart ( )

Ends the writing of a product 3D part.

Returns
dtkNoError : context has been correclty closed.
dtkErrorUserBreak : error in calling sequence.

◆ stepw_EndFile()

DtkErrorStatus stepw_EndFile ( )

Ends the writing of the current STEP file.

Returns
dtkNoError : file context has been correctly closed.

◆ stepw_EndNodeContext()

void stepw_EndNodeContext ( const int  unused = 0)

Ends current node context.

◆ stepw_EndProduct()

DtkErrorStatus stepw_EndProduct ( const int  inProductID)

Ends the writing of a product - calls WriteAssemblyInstances if not yet done.

Parameters
[in]inID: unique identifier for a product. Must be the same as for stepw_InitProduct.
Returns
dtkNoError : context has been correclty closed.
dtkErrorUnspecified : error in calling sequence.

◆ stepw_GiveUniqueFileName()

Dtk_string stepw_GiveUniqueFileName ( const Dtk_string inFileName)

Creates a unique file name for an external reference - applies to the current session (stepw_InitFile to stepw_EndFile).

Returns
"inFileName" if the input name wasn't registered as a file name yet.
"inFileName--i" if the input name was already registered as a file name. i is a integer set to make the name unique.

◆ stepw_GiveUniqueProductName()

Dtk_string stepw_GiveUniqueProductName ( const Dtk_string inProductName)

Creates a unique product name.

Remarks
if inProductName is an empty Dtk_string, it is inteprated as "Product".
Returns
"inProductName" if the input name wasn't registered as a product name yet.
"inProductName--i" if the input name was already registered as a product name. i is a integer set to make the name unique.

◆ stepw_Init3DPart()

DtkErrorStatus stepw_Init3DPart ( const int  inProductID)

Initializes the writing of a 3D part for the designated product.

Each product must have a 3D part, even empty : started by stepw_Init3DPart, ended by stepw_End3DPart. The 3D part can contain multiple geometries (body, mesh, wireframe).

Parameters
[in]inProductID: unique identifier of the product, provided by stepw_InitProduct.
Returns
dtkNoError if done, dtkErrorOutOfRange if no call to stepw_InitProduct was done previously, or ID wrong

◆ stepw_InitFile()

DtkErrorStatus stepw_InitFile ( const Dtk_string inFileName,
const char *  inOriginatingSystem = " user ",
const int  inSchema = 0 
)

Initializes a file to be written.

Parameters
[in]inFileName: Step File to write
[in]inOriginatingSystem: optional, designation of Originating system. Will be written in file header
[in]inSchema: specifies a protocol. Supported input : 1 for AP203(E1), 2 for AP214, 3 for AP203E2, 4 for AP242E1, 5 for AP242E4, 0 to adapt to content that will be written.
Remarks
AP203 will be used by default. AP214 will be used if colors are written. AP242 will be used if FDT are written.
Returns
dtkNoError : the file has been correctly initialized.
dtkErrorAPINotStarted : API was not started.
dtkErrorVersionNotSupported : input schema isn't supported.
dtkErrorLicence : licence checking has failed.

◆ stepw_InitNodeContext() [1/2]

void stepw_InitNodeContext ( const int  inNodeID)

Initializes the context to write entities in a node.

Typical entity that needs encapsulation in a node is FDT.

Parameters
inNodeID: the identifier attached to this node, must be positive and unique in the scope of a product.

◆ stepw_InitNodeContext() [2/2]

void stepw_InitNodeContext ( const int  inNodeID,
const Dtk_InfoPtr inNodeInfo 
)

Initializes the context to write entities in a node.

Parameters
inNodeInfo: additional information/attributes to qualify the node (color, layer, invisibility).
inNodeID: the identifier attached to this node, must be positive and unique in the scope of a product.

◆ stepw_InitProduct()

DtkErrorStatus stepw_InitProduct ( const Dtk_string inProductName,
int &  outAssignedID,
Dtk_ID  inProductUserID = 0 
)

Initializes the definition context of a product.

Warning
assigned name must be unique in the whole step file.
See also
stepw_WhichProductID, stepw_GiveUniqueProductName
Parameters
[in]inProductName: name to be assigned to the product.
[out]outAssignedID: assigned unique identifier of the product. To be used in other calls to identify it.
[in]inProductUserID: optional, if positive, defines a user identifier for this product.
Returns
dtkNoError : product context has been correctly initialized.
dtkErrorUnspecified : error in calling sequence.

◆ stepw_InitPropertySet()

Dtk_ErrorStatus stepw_InitPropertySet ( const int  inMode)

Sets attachment mode for next property writing : the whole Part, or to the following entity to be written.

Entities eligible for properties as metadata are : Dtk_Body, Dtk_Mesh. this mode is to be set for each entity, it is reset by stepw_End3DPart and by each writing of an entity with properties.

Parameters
[in]inMode: 0 attach property to the whole Part (default), 1 attach property to a body or mesh entity to be written.
Returns
dtkNoError the mode has been correctly set.
dtkErrorOutOfRange : input mode isn't supported.

◆ stepw_SetAnchorProduct()

DtkErrorStatus stepw_SetAnchorProduct ( const int  inProductID,
const int  inUserID 
)

Declares the product as having an ANCHOR section. If the designated product is already declared as such, sets its user-defined identifier.

Having an ANCHOR section allows the product to declare entities that can be referenced from outside of the product file, in cases where this product is written in a separated file.

Parameters
[in]inProductID: identifier of the product to declare.
[in]inUserID: identifier the user wants to provide to the product, to be able to retrieve it later.
See also
stepw_AnchorProductID
Returns
dtkNoError : the product is declared as having an ANCHOR section.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_SetContextTolerance()

Dtk_ErrorStatus stepw_SetContextTolerance ( const double  inTol)

Sets length tolerance for the 3D geometry (uncertainty).

To be called before stepw_Init3DPart, applies on all Parts till new call.

Parameters
[in]inTol: tolerance value, must be positive.
Remarks
Default applied tolerance is 0.005.
Returns
dtkNoError : the tolerance was correctly set.
dtkErrorUnspecified : input value is negative.

◆ stepw_SetContextUnit()

Dtk_ErrorStatus stepw_SetContextUnit ( const int  inLength,
const int  inAngle = 0 
)

Sets file units in which the geometries, properties are to be written.

To be called before stepw_Init3DPart. It applies on all Parts following its call.

Parameters
[in]inLength: Length Unit, 0 or 1 MM (default), 2 CM, 3 M, 4 KM, 5 IN(INCH), 6 FT(FOOT).
[in]inAngle: Angle Unit, 0 Radian (default), 1 Degree.
Warning
: all 3D data and values are assumed to be defined in the chosen units.
Returns
dtkNoError : the unit has been correctly set.
dtkErrorUnspecified : input value isn't supported.

◆ stepw_SetConversionLengthUnit()

Dtk_ErrorStatus stepw_SetConversionLengthUnit ( const int  inLength)

Sets file units in which the geometries, properties are to be written, and apply the conversion factor (from MM).

To be called before stepw_Init3DPart. It applies on all Parts following its call.

Parameters
[in]inLength: Length Unit, 0 or 1 MM (default), 2 CM, 3 M, 4 KM, 5 IN(INCH), 6 FT(FOOT).
Warning
: STEP writer will convert all 3D data and values to the defined length unit.
Returns
dtkNoError : the unit has been correctly set.
dtkErrorUnspecified : input value isn't supported.

◆ stepw_SetHeaderData() [1/2]

DtkErrorStatus stepw_SetHeaderData ( const int  inNumItem,
const Dtk_string inValItem 
)

Sets STEP file header fields value.

Parameters
[in]inNumItem: 0 description, 1 author, 2 organisation, 3 system, 4 authorization.
[in]inValItem: the value to be set. If empty, switch back to default settings for this field.
Returns
dtkNoError : value has been ccorectly set for this header field.
dtkErrorUnspecified : inNumItem is not a supported case.

◆ stepw_SetHeaderData() [2/2]

DtkErrorStatus stepw_SetHeaderData ( const int  inNumItem,
const wchar_t *  inValItem 
)

Sets STEP file header fields value.

Parameters
[in]inNumItem: 0 description, 1 author, 2 organisation, 3 system, 4 authorization.
[in]inValItem: the value to be set. If empty, switch back to default settings for this field.
Returns
dtkNoError : value has been ccorectly set for this header field.
dtkErrorUnspecified : inNumItem is not a supported case.

◆ stepw_SetInstanceUserID()

DtkErrorStatus stepw_SetInstanceUserID ( const int  inInstanceID,
const int  inInstanceUserID 
)

Sets the designated instance its user-defined identifier.

Parameters
[in]inInstanceID: the already assigned identifier of the designated instance.
[in]inInstanceUserID:the identifier the user wants to provide to the instance, that will be use in addition to the one assigned by this library.
Returns
dtkNoError user-defined identifier has been correctly set.
dtkErrorUnspecified : the provided instance identifier does not identify a registered instance.

◆ stepw_SetModeCompress()

DtkErrorStatus stepw_SetModeCompress ( const int  inMode)

Selects a mode of writing compact or compressed step files.

Parameters
[in]inMode: 0 normal mode, 1 output a compressed .stp.Z file (ZIP algorithm), 2 output an archive .stpa file.
Returns
dtkNoError : the mode has been correctly activated/deactivated.
dtkErrorUnspecified : input mode isn't supported.

◆ stepw_SetModeFdt()

DtkErrorStatus stepw_SetModeFdt ( const int  inMode,
const int  inPolyline = 2 
)

Activates/Deactivates writing of FDT.

Parameters
[in]inMode: FDT representation mode, -1 graphics only, 0 no writing, 1 fully semantic (with graphics).
[in]inPolyline: FDT presentation mode (graphic output), 1 minimal (placeholder), 2 polyline, 3 tessellated.
Returns
dtkNoError : the mode has been correctly activated/deactivated.
dtkErrorUnspecified : input mode isn't supported.
dtkErrorLicence : licence checking has failed.

◆ stepw_SetModeInfoFirstFace()

DtkErrorStatus stepw_SetModeInfoFirstFace ( bool  inModeInfoFirstFace)

On a solid or shell, allows the spreading of its first available face graphical attributes to the whole solid/shell.

Remarks
If the whole solid/shell has a color defined, this has no effect.
Parameters
[in]inMode: true to activate, false to deactivate.
Returns
dtkNoError : the mode has been correctly activated/deactivated.
dtkErrorUnspecified : input mode isn't supported.

◆ stepw_SetModeItemName()

DtkErrorStatus stepw_SetModeItemName ( const int  inMode)

Selects a mode for topological 3D items naming policy (shells, faces, edges ).

Parameters
[in]inMode: 0 no writing (empty name), 1 use name recorded in Dtk_Info, 2 use ID recorded in Dtk_Info (as "no [ID]").
Returns
dtkNoError : the mode has been correctly activated/deactivated.
dtkErrorUnspecified : input mode isn't supported.

◆ stepw_SetModeProp()

DtkErrorStatus stepw_SetModeProp ( const int  inMode)

Activates/Deactivates writing of properties : User Attributes, Product Data.

Parameters
[in]inMode: determines what input attributes or properties will be written. 0 no writing, 1 attributes ( stored in Dtk_Info ) and product data, 2 same as 1, with also metadata (Dtk_MetaData::TypeFileProperty and Dtk_MetaData::TypeUnknown are filtered), 3 same as 2, without any Dtk_Metadata filtering
Returns
dtkNoError : the mode has been correctly activated/deactivated.
dtkErrorUnspecified : input mode isn't supported.

◆ stepw_SetPartProperties()

DtkErrorStatus stepw_SetPartProperties ( const Dtk_InfoPtr inInfo,
const int  inItem 
)

Defines properties to be attached directly to the product : considers the list of Dtk_Val in the Dtk_Info.

Parameters
[in]inInfo: the Dtk_Info which brings the Dtk_Val objects to be written as properties.
[in]inItem: 0 dispatched between part (PDS) and product (PD), 1 on part only, 2 on product only. PDS = PRODUCT_DEFINITION_SHAPE or part, PD = PRODUCT_DEFINITION or product.
Warning
: must be called before stepw_Init3DPart of the product to be populated. dispatch is done according to CAX-IF recommended practices for Geometric and Assembly Validation Properties.
Returns
dtkNoError : properties has been correctly attached.
dtk_ErrorOutOfRange : inItem value is not supported.
dtkErrorUnspecified : error in calling sequence.

◆ stepw_SetProductLayerInfosSet()

DtkErrorStatus stepw_SetProductLayerInfosSet ( const Dtk_LayerInfosSetPtr  inLayerInfoSet)

Sets the LayerInfosSet to refer to when writing the current product. It uses its mapping between layer identifier and name.

3D shapes can be assigned to a layer (through a layer index, in Dtk_Info). The Dtk_LayerInfoSet can further qualify those layers, by assigning them a name. Setting the LayerInfoSet for the product has to happen after stepw_InitProduct, and before any calls to stepw_Write3DPartBody, to be taken into account.

Parameters
[in]inLayerInfoSet: Pointer to the LayerInfosSet to refer to, in order to assign names to layers.
Returns
dtkNoError : LayerInfosSet has been correctly set for current product context.
dtkErrorUnspecified : error in calling sequence.

◆ stepw_SetReferencePath()

DtkErrorStatus stepw_SetReferencePath ( stepw_ER inOutElementReference,
stepw_ERP inElementReferencePath 
)

Assigns the element reference path to the element reference.

Parameters
[in,out]inOutElementReference: the element reference to which the path will be assigned.
[in]inElementReferencePath: the path to assign to the element reference.
Returns
dtkNoError : the path has been assigned.
dtkErrorUnspecified : either inOutElementReference or inElementReferencePath content is empty.
dtkErrorOpenFiles : STEPWriter is not initialized.

◆ stepw_WhichInstanceID()

int stepw_WhichInstanceID ( const int  inUserID)

Checks if an instance (known by its user-defined identifier), is already registered.

Returns
0 : an instance with this user-defined identifier isn't registered yet.
strictly positive value : the identifier of the instance alredy registered with this user-defined identifier.

◆ stepw_WhichProductID()

int stepw_WhichProductID ( const Dtk_string inProductName)

Checks if a product (known by its unique name), is already registered.

Returns
-1 : a product with this name isn't registered yet.
positive value : the identifier of the product alredy registered with this name.

◆ stepw_Write3DAxisSystem()

DtkErrorStatus stepw_Write3DAxisSystem ( const Dtk_AxisSystemPtr inAxis)

Writes an axis system of a 3D part, in STEP, it is a construction geometry based on an axis placement.

Usually used to complement FDT definition.

Parameters
[in]inAxis: the axis to be written.
Returns
dtkNoError : the axis has been correctly written.
dtkErrorUnspecified : part context hasn't been initialized.
dtkErrorNullPointer : inAxis is null.
dtkErrorTypeNotsupported : not supported in AP203 version.

◆ stepw_Write3DConstructionGeometry()

DtkErrorStatus stepw_Write3DConstructionGeometry ( const Dtk_BodyPtr inBody)

Writes a body as a construction geometry of a 3D part, of any kind (solid, shell / faces, wireframe / points).

Usually used to complement FDT definition.

Parameters
[in]inBody: the body to be written.
Returns
dtkNoError : the body has been correctly written.
dtkErrorUnspecified : part context hasn't been initialized.
dtkErrorNullPointer : inBody is null.
dtkErrorTypeNotsupported : not supported in AP203 version.

◆ stepw_Write3DPartBody()

DtkErrorStatus stepw_Write3DPartBody ( const Dtk_BodyPtr inBody)

Writes a body of a 3D part (3D content of a product), of any kind (solid, shell / faces, wireframe / points).

Parameters
[in]inBody: the body to be written.
Returns
dtkNoError : the body has been correctly written.
dtkErrorUnspecified : part context hasn't been initialized.
dtkErrorNullPointer : inBody is null.

◆ stepw_Write3DPartBodyWithMesh()

DtkErrorStatus stepw_Write3DPartBodyWithMesh ( const Dtk_BodyPtr inBody,
const Dtk_MeshPtr inMesh,
const int  inMode = 0 
)

Writes a body of a 3D part (3D content of a product), associated with a mesh.

The mesh is assumed to be the result of computing tessellation on the body in case of association : its items can be bound with items of the body.

Warning
not recommended for STEP versions before AP242.
Parameters
[in]inBody: the body to be written.
[in]inMesh: the mesh to be written, ignored if null.
[in]inMode: mode of association, 0 as additional representation (default), 1 as alternate geometry (ignored before AP242).
Returns
dtkNoError : the body has been correctly written.
dtkErrorUnspecified : part context hasn't been initialized.
dtkErrorNullPointer : inBody is null.

◆ stepw_Write3DPartMesh()

DtkErrorStatus stepw_Write3DPartMesh ( const Dtk_MeshPtr inMesh)

Writes a mesh of a 3D part (3D content of a product).

Default is mockup mesh. If no mockup is defined, basic triangles are written instead.

Warning
: correct mapping is with mockup; writing basic triangles of meshes is not efficient.
Parameters
[in]inMesh: the mesh to be written.
Returns
dtkNoError : the mesh has been correctly written.
dtkErrorUnspecified : part context hasn't been initialized.
dtkErrorNullPointer : inMesh is null.

◆ stepw_Write3DPartMeshFromBody()

DtkErrorStatus stepw_Write3DPartMeshFromBody ( const Dtk_MeshPtr inMesh,
const Dtk_BodyPtr inBody 
)

Writes a mesh of a 3D part (3D content of a product), coming from a body, without writing the body itself.

The mesh is assumed to be the result of computing tessellation on the body in case of association : its items can be bound with items of the body.

See also
Write3DPartBodyWithMesh : writes both the body and the mesh.
Parameters
[in]inMesh: the mesh to be written.
[in]inBody: the body it comes from (not written), ignored if null (acts as Write3DPartMesh).
Returns
dtkNoError : the mesh has been correctly written.
dtkErrorUnspecified : part context hasn't been initialized.
dtkErrorNullPointer : inMesh is null.

◆ stepw_WriteAssemblyInstances()

DtkErrorStatus stepw_WriteAssemblyInstances ( const int  inID)

Writes instances detained by a product.

See also
stepw_EndProduct.
Parameters
[in]inID: unique identifier for a product. Must be the same as for stepw_InitProduct.
Returns
dtkNoError : instances have been correctly written.
dtkErrorUnspecified : error in calling sequence.

◆ stepw_WriteExternalReference()

Dtk_ErrorStatus stepw_WriteExternalReference ( const int  inID)

Writes a product as an external reference. Only one per file for a given product.

Applies only on a product which has previously been declared as external by AddExternalReference.

See also
stepw_AddExternalReference.
Parameters
[in]inID: the identifier of the product. Must repeat the ID of the product given by AddExternalReference. It is not necessary to call it : the first instance that uses this product will call automatically this function.
Returns
dtkNoError : the external reference has been correctly written.
dtkOutOfRange : inID does not identify a product.
dtkErrorUserBreak : external reference for this product has alredy already written.
dtkErrorUnspecified : the product was not declared by AddExternalReference.