DATAKIT API  V2025.1
Ugw Namespace Reference

Functions

Dtk_ErrorStatus AddExternInstance (const Dtk_string &inProtoFileName, const Dtk_transfo &inTrans, Dtk_InfoPtr inInfos, void(*innxread_getdata)(const Dtk_string &, void *&))
 Open an extern file to add as instance in current assembly, inProtoFileName must be in the output directory. Just give name without path and extension. More...
 
Dtk_ErrorStatus AddMetaData (const Dtk_MetaDataPtr &inMeta)
 Add a MetaData in the current component. More...
 
Dtk_ErrorStatus CloseLastInstance ()
 Close the last instance. More...
 
Dtk_ErrorStatus EndFile ()
 Close the UG file. More...
 
Dtk_ErrorStatus GetColorInTable (size_t inIth, Dtk_RGB &outColor, Dtk_string &outColorname)
 Get color value and color name from the palette. More...
 
Dtk_ErrorStatus ImportCdfColorfile (const Dtk_string &InCdfFile)
 Import a color palette. More...
 
Dtk_ErrorStatus InitFile (const Dtk_string &inFilename, int inVersiontowrite=45, int inUnitasmm=1, int inMultithread=0)
 Initialize UG Writer. More...
 
Dtk_ErrorStatus OpenInstance (const Dtk_string &inInstanceName, const Dtk_string &inProtoFileName, Dtk_bool &outWasAlreadyInstancied, const Dtk_transfo &inTrans, const Dtk_RGB &inRgb)
 deprecated More...
 
Dtk_ErrorStatus OpenInstance (const Dtk_string &inProtoFileName, const Dtk_transfo &inTrans, Dtk_InfoPtr inInfos)
 Open an child instance to write an assembly. More...
 
Dtk_ErrorStatus SetColorInTable (size_t inIth, const Dtk_RGB &inColor, const Dtk_string &inColorname)
 Replace color value and color name on the palette. More...
 
Dtk_ErrorStatus SetGroupDatas (const Dtk_string &inGroupName, Dtk_InfoPtr inInfos)
 define Visibility for a specific group More...
 
Dtk_ErrorStatus SetGroupVisibility (const Dtk_string &inGroupName, Dtk_bool inVisible)
 
Dtk_ErrorStatus SetLayerData (const Dtk_LayerInfosSetPtr &inLayerDataSet, const Dtk_tab< Dtk_Int32 > &inVisibles=Dtk_tab< Dtk_Int32 >(), const Dtk_tab< Dtk_Int32 > &inSelectables=Dtk_tab< Dtk_Int32 >())
 define Data for layers More...
 
Dtk_ErrorStatus WriteAxisSystem (const Dtk_AxisSystemPtr &inAxisSystem)
 Add an axis system into the current node. More...
 
Dtk_ErrorStatus WriteBody (const Dtk_BodyPtr &inBody)
 Add a body inside the file. More...
 
Dtk_ErrorStatus WriteExternJtMesh (const char *inFlux, size_t inSize, const Dtk_InfoPtr &inInf)
 Add a JT file as lightweight body inside the file. More...
 
Dtk_ErrorStatus WriteExternParasolidBody (const char *inFlux, size_t inSize, const Dtk_InfoPtr &inInf)
 Add a Parasolid file as body inside the file. More...
 
Dtk_ErrorStatus WriteMesh (const Dtk_MeshPtr &inMesh)
 Add a mesh inside the file. More...
 
Dtk_ErrorStatus WritePMI (const Dtk_FdtPtr &inPmi)
 Add a pmi inside the file. More...
 
Dtk_ErrorStatus WriteReferenceGeometry (const Dtk_BodyPtr &inRefgeom)
 Add a reference geometry into the current node. More...
 

Function Documentation

◆ AddExternInstance()

Dtk_ErrorStatus Ugw::AddExternInstance ( const Dtk_string inProtoFileName,
const Dtk_transfo inTrans,
Dtk_InfoPtr  inInfos,
void(*)(const Dtk_string &, void *&)  innxread_getdata 
)

Open an extern file to add as instance in current assembly, inProtoFileName must be in the output directory. Just give name without path and extension.

Parameters
[in]inProtoFileName: Prototypename, also file name : for a subassembly reinstancied, this name must be the same for all instances
[in]inTrans: Matrix of this instance. Dtk_transfo() for identity Matrix
[in]inInfos: Additional informations, see options supported; same as OpenInstance
[in]innxread_getdata: Function nxread_getdata of Datakit NXReader, retrieving subassemblies from extern, can be NULL.

◆ AddMetaData()

Dtk_ErrorStatus Ugw::AddMetaData ( const Dtk_MetaDataPtr inMeta)

Add a MetaData in the current component.

Parameters
[in]inMeta: Metadata to add.
Remarks
Special Metadatas with Category = "Modeling Preferences"
Title = "Distance Tolerance" & Value = tolerance in mm
Title = "Angle Tolerance" & Value = tolerance in degree
Title = "Density" & Value = Density
Title = "Density Units" & Value = "lb/in3" or "lb/ft3" or "g/m3" or "kg/m3"
Returns
dtkNoError if ok.

◆ CloseLastInstance()

Dtk_ErrorStatus Ugw::CloseLastInstance ( )

Close the last instance.

Returns
dtkNoError if ok.

◆ EndFile()

Dtk_ErrorStatus Ugw::EndFile ( )

Close the UG file.

Returns
dtkNoError if ok.

◆ GetColorInTable()

Dtk_ErrorStatus Ugw::GetColorInTable ( size_t  inIth,
Dtk_RGB outColor,
Dtk_string outColorname 
)

Get color value and color name from the palette.

Parameters
[in]inIth: Color index, from 0 (background) to 216 (max color index)
[out]outColor: Color to retrieve
[out]outColorname: Color name to retrieve
Returns
dtkNoError if ok.

◆ ImportCdfColorfile()

Dtk_ErrorStatus Ugw::ImportCdfColorfile ( const Dtk_string InCdfFile)

Import a color palette.

Parameters
[in]InCdfFile: Cdf file to import
Returns
dtkNoError if ok.

◆ InitFile()

Dtk_ErrorStatus Ugw::InitFile ( const Dtk_string inFilename,
int  inVersiontowrite = 45,
int  inUnitasmm = 1,
int  inMultithread = 0 
)

Initialize UG Writer.

Parameters
[in]inFilename: Name of output file to write.
[in]inVersiontowrite: Version to write, only UGW_VERSION_NX5 available for now
[in]inUnitasmm: Unit, default in millimeters, set 0 for inches.
[in]inMultithread: Enable multithreading (efficiency in assemblies with lot of parts)
Returns
dtkNoError if ok.

◆ OpenInstance() [1/2]

Dtk_ErrorStatus Ugw::OpenInstance ( const Dtk_string inInstanceName,
const Dtk_string inProtoFileName,
Dtk_bool outWasAlreadyInstancied,
const Dtk_transfo inTrans,
const Dtk_RGB inRgb 
)

deprecated

◆ OpenInstance() [2/2]

Dtk_ErrorStatus Ugw::OpenInstance ( const Dtk_string inProtoFileName,
const Dtk_transfo inTrans,
Dtk_InfoPtr  inInfos 
)

Open an child instance to write an assembly.

Parameters
[in]inProtoFileName: Prototypename, also file name : for a subassembly reinstancied, this name must be the same for all instances
[in]inTrans: Matrix of this instance. Dtk_transfo() for identity Matrix
[in]inInfos: Additional informations, see options supported
Remarks
inInfos->SetName(InstanceName) to give an instance name (default instance has same name as part)
inInfos->SetColor(Dtk_Rgb) to give an instance color
inInfos->SetBlankedStatus(1) to set component as invisible
inInfos->SetLayer(l) to set a specific component layer
Returns
dtkNoError if ok.

◆ SetColorInTable()

Dtk_ErrorStatus Ugw::SetColorInTable ( size_t  inIth,
const Dtk_RGB inColor,
const Dtk_string inColorname 
)

Replace color value and color name on the palette.

Parameters
[in]inIth: Color index, from 0 (background) to 216 included (max color index)
[in]inColor: Color to set
[in]inColorname: Color name to set
Returns
dtkNoError if ok.

◆ SetGroupDatas()

Dtk_ErrorStatus Ugw::SetGroupDatas ( const Dtk_string inGroupName,
Dtk_InfoPtr  inInfos 
)

define Visibility for a specific group

Parameters
[in]inGroupName: Name of group
[in]inInfos: Additional informations, see options supported
Remarks
inInfos->SetBlankedStatus(1) to set component as invisible
inInfos->SetLayer(l) to set a specific component layer
inInfos->AddAttribute("NXGROUPS",chain) create an empty group, see example

◆ SetGroupVisibility()

Dtk_ErrorStatus Ugw::SetGroupVisibility ( const Dtk_string inGroupName,
Dtk_bool  inVisible 
)
Remarks
Deprecated, use SetGroupDatas

◆ SetLayerData()

Dtk_ErrorStatus Ugw::SetLayerData ( const Dtk_LayerInfosSetPtr inLayerDataSet,
const Dtk_tab< Dtk_Int32 > &  inVisibles = Dtk_tabDtk_Int32 >(),
const Dtk_tab< Dtk_Int32 > &  inSelectables = Dtk_tabDtk_Int32 >() 
)

define Data for layers

Parameters
[in]inLayerDataSet: LayerDataSet, see example
[in]inVisibles: Array of visiblity for layers
[in]inSelectables: Array of selectability for layers
Remarks
default visibles and selectables

◆ WriteAxisSystem()

Dtk_ErrorStatus Ugw::WriteAxisSystem ( const Dtk_AxisSystemPtr inAxisSystem)

Add an axis system into the current node.

Parameters
[in]inAxisSystem: axis system to Write.
Remarks
, in info field, SetName to set FeatureName, AddAttribute("NXNAME") to set the object name
Returns
dtkNoError if ok.

◆ WriteBody()

Dtk_ErrorStatus Ugw::WriteBody ( const Dtk_BodyPtr inBody)

Add a body inside the file.

Parameters
[in]inBody: Body to add.
Remarks
Body Infos->AddAttribute("NXGROUPS",chain) to set groups, see example.
Returns
dtkNoError if ok.

◆ WriteExternJtMesh()

Dtk_ErrorStatus Ugw::WriteExternJtMesh ( const char *  inFlux,
size_t  inSize,
const Dtk_InfoPtr inInf 
)

Add a JT file as lightweight body inside the file.

Parameters
[in]inFlux: Raw JT file to add.
[in]inSize: Size of flux.
[in]inInf: Additionnal informations. (name, visibility, default colors)
Returns
dtkNoError if ok.

◆ WriteExternParasolidBody()

Dtk_ErrorStatus Ugw::WriteExternParasolidBody ( const char *  inFlux,
size_t  inSize,
const Dtk_InfoPtr inInf 
)

Add a Parasolid file as body inside the file.

Parameters
[in]inFlux: Raw parasolid file to add.
[in]inSize: Size of flux.
[in]inInf: Additionnal informations. (name, visibility, default colors)
Returns
dtkNoError if ok.

◆ WriteMesh()

Dtk_ErrorStatus Ugw::WriteMesh ( const Dtk_MeshPtr inMesh)

Add a mesh inside the file.

Parameters
[in]inMesh: Mesh to add.
Returns
dtkNoError if ok.

◆ WritePMI()

Dtk_ErrorStatus Ugw::WritePMI ( const Dtk_FdtPtr inPmi)

Add a pmi inside the file.

Parameters
[in]inPmi: Pmi to add.
Remarks
Actually just some annotations are supported, see documentation
Returns
dtkNoError if ok, dtkErrorCannotCompute if not supported Pmi

◆ WriteReferenceGeometry()

Dtk_ErrorStatus Ugw::WriteReferenceGeometry ( const Dtk_BodyPtr inRefgeom)

Add a reference geometry into the current node.

Remarks
Stored is a body as one face with plane for reference plane, trimmed reference plane for fixed reference plane, wire segment for reference axis, wire point for reference point
Parameters
[in]inRefgeom: reference geometry to Write.
Remarks
, in info field, SetName to set FeatureName, AddAttribute("NXNAME") to set the object name
Returns
dtkNoError if ok.