DATAKIT API  V2025.1
solidworksw Namespace Reference

Exported APIs for solidworks Write Library. More...

Data Structures

class  FileDescription
 This class provides several informations about a Solidworks File.
It can be used with solidworksw::OpenPart and solidworksw::OpenAssembly functions to specify file properties. More...
 
class  Instance
 This class provides Instance about a Solidworks File.
It can be used with solidworksw::OpenAssembly functions to Add Instance. More...
 

Enumerations

enum  language {
  french =0, english =1, italian =2, deutch =3,
  chinese =4
}
 

Functions

Dtk_ErrorStatus AddEntity (const Dtk_EntityPtr &inEntity)
 Write the entity provided in parameter. More...
 
Dtk_ErrorStatus AddInstanceComponent (Instance &inInstance)
 Add an instance into the Current Assembly (sldasm). More...
 
Dtk_ErrorStatus AddMetaData (const Dtk_MetaDataPtr &inEntity)
 
Dtk_ErrorStatus AddParasolidFile (const Dtk_string &inParasolidFile)
 Add parasolid file. More...
 
Dtk_ErrorStatus AddParasolidId (const Dtk_Int32 &inParasolidId)
 Add parasolid Id body. More...
 
Dtk_ErrorStatus CloseAssembly ()
 Write effectively the Assembly initialized by solidworksw::OpenAssembly. More...
 
Dtk_ErrorStatus ClosePart ()
 Free data allocated by solidworksw::OpenPart
More...
 
Dtk_ErrorStatus EndWriter ()
 Free the Solidworks Writer
More...
 
Dtk_ErrorStatus InitWriter (const Dtk_string &inLogFile, Licence_dtk inLicFct, solidworksw::language inLanguage=solidworksw::english)
 Initialize the Solidworks Writer
More...
 
Dtk_ErrorStatus OpenAssembly (const Dtk_string &inFileName, const solidworksw::FileDescription &inFileDescription=solidworksw::FileDescription(), Dtk_Unit inUnit=DTK_UNIT_MM, const Dtk_string &inConfigurationName=Dtk_string())
 Initialize a Assembly .
More...
 
Dtk_ErrorStatus OpenPart (const Dtk_string &inSolidworksFile, const solidworksw::FileDescription &inFileDescription=solidworksw::FileDescription(), Dtk_Unit inUnit=DTK_UNIT_MM, const Dtk_string &inConfigurationName=Dtk_string())
 Initialize the part
More...
 
void OptionRemoveComment (Dtk_Int32 inRemoveComment)
 option to not store the comment More...
 
void OptionStoreBodyColor (Dtk_Int32 inStoreBodyColor)
 option to store the body color More...
 
void SetIsAlreadyStart (const Dtk_Int32 &inStop)
 ONLY for PSKERNEL user. More...
 

Detailed Description

Exported APIs for solidworks Write Library.

Enumeration Type Documentation

◆ language

Enumerator
french 
english 
italian 
deutch 
chinese 
15  {
16  french=0,
17  english=1,
18  italian=2,
19  deutch=3,
20  chinese=4
21  };

Function Documentation

◆ AddEntity()

Dtk_ErrorStatus solidworksw::AddEntity ( const Dtk_EntityPtr inEntity)

Write the entity provided in parameter.

Parameters
[in]inEntity: The Entity to be written
Returns
dtkNoError if it is OK.
Remarks
This function is used to write entities .

◆ AddInstanceComponent()

Dtk_ErrorStatus solidworksw::AddInstanceComponent ( Instance inInstance)

Add an instance into the Current Assembly (sldasm).

Parameters
[in]inInstance: Instance definitionwith (Full path name , instance name and position.
Returns
dtkNoError if it is OK.

◆ AddMetaData()

Dtk_ErrorStatus solidworksw::AddMetaData ( const Dtk_MetaDataPtr inEntity)

◆ AddParasolidFile()

Dtk_ErrorStatus solidworksw::AddParasolidFile ( const Dtk_string inParasolidFile)

Add parasolid file.

Parameters
[in]inParasolidFile: Name of the Parasolid File to be added.
Remarks
only work with pskernel writer.

◆ AddParasolidId()

Dtk_ErrorStatus solidworksw::AddParasolidId ( const Dtk_Int32 inParasolidId)

Add parasolid Id body.

Parameters
[in]inParasolidId: Id of the Parasolid body to be added.
Remarks
only work with pskernel writer.

◆ CloseAssembly()

Dtk_ErrorStatus solidworksw::CloseAssembly ( )

Write effectively the Assembly initialized by solidworksw::OpenAssembly.

Returns
dtkNoError if it is OK.

◆ ClosePart()

Dtk_ErrorStatus solidworksw::ClosePart ( )

Free data allocated by solidworksw::OpenPart

Returns
dtkNoError if it is OK.
Remarks
used at the end of conversion.

◆ EndWriter()

Dtk_ErrorStatus solidworksw::EndWriter ( )

Free the Solidworks Writer

Returns
dtkNoError if it is OK.
Remarks
used at the last function used for the writer.

◆ InitWriter()

Dtk_ErrorStatus solidworksw::InitWriter ( const Dtk_string inLogFile,
Licence_dtk  inLicFct,
solidworksw::language  inLanguage = solidworksw::english 
)

Initialize the Solidworks Writer

Returns
dtkNoError if it is OK.
Remarks
This is the first function called for the writer.
Parameters
[in]inLogFile: Log file
[in]inLicFct: Licence fuction or Null
[in]inLanguage: by default solidworksw::english

◆ OpenAssembly()

Dtk_ErrorStatus solidworksw::OpenAssembly ( const Dtk_string inFileName,
const solidworksw::FileDescription inFileDescription = solidworksw::FileDescription(),
Dtk_Unit  inUnit = DTK_UNIT_MM,
const Dtk_string inConfigurationName = Dtk_string() 
)

Initialize a Assembly .

Parameters
[in]inFileName: Name of the Solidworks Assembly (sldasm) file to be written.
[in]inConfigurationName: Name of the configuration of the Solidworks Assembly (sldasm) file to be written.
[in]inFileDescription: Description File
Returns
dtkNoError if it is OK.
Remarks
The given path into inFileName must exist and you must have write permission in this folder.

◆ OpenPart()

Dtk_ErrorStatus solidworksw::OpenPart ( const Dtk_string inSolidworksFile,
const solidworksw::FileDescription inFileDescription = solidworksw::FileDescription(),
Dtk_Unit  inUnit = DTK_UNIT_MM,
const Dtk_string inConfigurationName = Dtk_string() 
)

Initialize the part

Remarks
used at the beginning of conversion.
Parameters
[in]inOutputFile: Name of the Solidworks Part (sldprt) file to be Written.
[in]inFileDescription: Description File
[in]inConfigurationName: Name of the Configuration of the Solidworks Part (sldprt) file to be Written.
Remarks
The given path into inOutputFile must exist and you must have write permission in this folder.

◆ OptionRemoveComment()

void solidworksw::OptionRemoveComment ( Dtk_Int32  inRemoveComment)

option to not store the comment

Parameters
[in]inRemoveComment: used DTK_TRUE for not removing comment
Remarks
used after InitWriter

◆ OptionStoreBodyColor()

void solidworksw::OptionStoreBodyColor ( Dtk_Int32  inStoreBodyColor)

option to store the body color

Parameters
[in]inStoreBodyColor: used DTK_TRUE for enabled
Remarks
used after InitWriter

◆ SetIsAlreadyStart()

void solidworksw::SetIsAlreadyStart ( const Dtk_Int32 inStop)

ONLY for PSKERNEL user.

Returns
dtkNoError if it is OK.
Remarks
Informs that the session is started
Parameters
[in]inStop: set -1 after StartParasolid
solidworksw::french
@ french
Definition: solidworksw.hpp:16
solidworksw::chinese
@ chinese
Definition: solidworksw.hpp:20
solidworksw::english
@ english
Definition: solidworksw.hpp:17
solidworksw::deutch
@ deutch
Definition: solidworksw.hpp:19
solidworksw::italian
@ italian
Definition: solidworksw.hpp:18