CrossManager CLI Help  V2026.4
CrossCadWare.h
1 /**********************************************************
2  * CrossCadWare.h
3  **********************************************************/
4 
5 #ifndef _CROSSCADWARE_H_
6 #define _CROSSCADWARE_H_
7 
8 //FormatsDefinition
9 
10 #define DTK_IN 1 // Internal use
11 #define DTK_ACIS 2 // Acis files .sat or .sab
12 #define DTK_STEP 4 // Step files .stp .step
13 #define DTK_PARASOLID 5 // Parasolid files .x_t .x_b .xmt
14 #define DTK_IGES 6 // Iges files .igs .iges
15 #define DTK_CATIAV4 8 // Catia V4 files
16 #define DTK_CATIAV5 9 // Catia V5 files
17 #define DTK_PROE 12 // ProEngineer - Creo files
18 #define DTK_ROBFACE 13 // Robface files
19 #define DTK_ROBFACE_FACET 14 // Robface facetted files
20 #define DTK_SOLIDWORKS 15 // Solidworks files
21 #define DTK_SOLIDEDGE 16 // Solidedge files
22 #define DTK_UNIGRAPHICS 17 // Unigraphics NX files
23 #define DTK_UNISURF 20 // Unisurf files
24 #define DTK_JT 21 // Jt files
25 #define DTK_STL 22 // Stl files
26 #define DTK_VRML 23 // Vrml files
27 #define DTK_INVENTOR 25 // Inventor files
28 #define DTK_CGR 26 // Cgr files
29 #define DTK_3DXML 28 // 3DXml files
30 #define DTK_DXF 33 // Dxf 2D Files
31 #define DTK_CATIAV6 34 // Catia V6 files
32 #define DTK_DWG 35 // Dwg files
33 #define DTK_PLMXML 36 // PLM Xml files
34 #define DTK_COLLADA 37 // Collada files
35 #define DTK_PDF 39 // Pdf 3D files
36 #define DTK_OCC 42 // Open Cascade files
37 #define DTK_BREPOCC 42 // Open Cascade Brep files
38 #define DTK_PDF2D 43 // Pdf Drawing files
39 #define DTK_3DM 44 // Rhinoceros 3D files
40 #define DTK_OBJ 45 // Rhinoceros 3D files
41 #define DTK_PARASOLIDB 46 // Parasolid files .x_b
42 #define DTK_PRC 47 // PRC files
43 #define DTK_IFC 48 // IFC files
44 #define DTK_EMF 49 // EMF files
45 #define DTK_3MF 50 // 3MF files
46 #define DTK_RVT 52 // Revit files
47 #define DTK_CRV 53 // CreoView files
48 #define DTK_GLTF 54 // Gltf files
49 #define DTK_FBX 55 // Fbx files
50 #define DTK_SMG 58 // Smg files
51 #define DTK_F3D 59 // F3d files
52 #define DTK_NAVIS 62 // Navis files
53 #define DTK_DXF3D 63 // DXF 3D files
54 #define DTK_QIF 65 // Qif files
55 #define DTK_ZW3D 66 // Zw3d files
56 #define DTK_USD 67 // Usd files
57 
58 //End_FormatsDefinition
59 
60 ///! \brief Callback function to monitor the progress of a file conversion
61 //!
62 //! \param[in] inProgressBarNumber Progress bar ID
63 //! \param[in] inPercent Current progress percentage
64 typedef void( *Progress_dtk ) ( int* inProgressBarNumber, int* inPercent );
65 
66 //MainFunctions
67 
68 //! \brief Returns the version number of CrossCadWare.dll
69 //!
70 //! \return int Version number of CrossCadWare.dll
71 typedef int( *GetProductVersionFunction ) ( );
72 
73 //! \brief Returns the release number of CrossCadWare.dll
74 //!
75 //! \return int Release number of CrossCadWare.dll
76 typedef int( *GetProductReleaseFunction ) ( );
77 
78 //! \brief Converts an input file to the requested output format.
79 //!
80 //! Uses the Datakit/CrossCadWare libraries and the provided configuration file.
81 //!
82 //! \param[in] inInputFormat File type to read (see supported formats defined above)
83 //! \param[in] inOutputFormat File type to write (see supported formats defined above)
84 //! \param[in] inInputFile Path to the input file to read
85 //! \param[in] inOutputFile Path to the output file to write
86 //! \param[in] inConfigFile Path to the configuration file (use the config file delivered with the DLL to ensure proper options are selected)
87 //! \param[in] inSchemaDirectory Path to the Parasolid schema directory, or NULL (required for Unigraphics/NX, SolidWorks, Parasolid, Solid Edge files)
88 //! \param[in] inProgressBarFunction Progress callback function or NULL (see Progress_dtk() declaration above)
89 //! \param[in] inRemoveProgressDialogBoxes Set to 1 to suppress dialog boxes, 0 to allow them
90 //! \param[in] inSerial Customer key ID provided by Datakit, or NULL
91 //! \param[in] inFutureUse0 Reserved for future use — set to 0
92 //! \param[in] inFutureUse1 Reserved for future use
93 //! \param[in] inFutureUse2 Reserved for future use
94 //! \param[in] inFutureUse3 Reserved for future use
95 //! \param[in] inSerialTest Test customer key ID provided by Datakit, or NULL
96 //!
97 //! \return int Error code: 0 on success, non-zero on failure (see errors below)
98 typedef int( *ConvertFunction )(
99  int inInputFormat,
100  int inOutputFormat,
101  wchar_t* inInputFile,
102  wchar_t* inOutputFile,
103  wchar_t* inConfigFile,
104  wchar_t* inSchemaDirectory,
105  Progress_dtk inProgressBarFunction,
106  int inRemoveProgressDialogBoxes,
107  wchar_t* inSerial,
108  int inFutureUse0,
109  int inFutureUse1,
110  int inFutureUse2,
111  int inFutureUse3,
112  wchar_t* inSerialTest );
113 
114 //ErrorDefinitions
115 
116 // dtkWarningInvalidArgument = -1010, // File extension and file format do not match
117 // dtkErrorUnspecified = -1001, // Unspecified error
118 // dtkErrorTypeNotSupported = -1000, // File format invalid or not supported
119 // dtkWarningNoEntitiesWritten = -32, // No entities were written to the output file
120 // dtkErrorFileNotExist = -28, // Input file does not exist
121 // dtkErrorVersionNotSupported = -27, // File version not supported
122 // dtkErrorOpenOutputFile = -23, // Cannot open output file
123 // dtkErrorOpenInputFile = -22, // Cannot open input file
124 // dtkErrorSchemaNotFound = -15, // Missing Schema file
125 // dtkErrorOpenConfigFile = -13, // Cannot open configuration file
126 // dtkErrorOutputFile = -6, // Output file error
127 // dtkErrorInputFile = -5, // Input file error
128 // dtkErrorLicence = -4, // License error
129 // dtkErrorLicenceCmd = -44, // License error
130 // dtkErrorOpenFiles = -2, // Cannot open files
131 // dtkErrorAllocation = -1, // Memory allocation error
132 // dtkNoError = 0, // No error (success)
133 // dtkErrorUserBreak = 1, // Conversion aborted by user
134 
135 //End_ErrorDefinitions
136 
137 //! \brief Returns the file format code corresponding to the predefined constants.
138 //!
139 //! This function checks the input file and returns the matching format code (see formats defined above)
140 //! If the format is unknown, the function returns 0.
141 //!
142 //! \return int Format code of the file, or 0 if unknown
143 typedef int ( *CheckFileFormatFunction )( const wchar_t* inInputFile );
144 
145 //! \brief Returns the file format code corresponding to the predefined constants.
146 //!
147 //! This function checks the input file and returns the matching format code (see formats defined above)
148 //! If the format is unknown, the function returns 0.
149 //!
150 //! \return int Format code of the file, or 0 if unknown
151 typedef int ( *CheckFileFormatFunctionA )( const char* inInputFile );
152 
153 //! \brief Returns the file format as a string.
154 //!
155 //! This function retrieves the format of the given file
156 //! and returns it as a human-readable string.
157 //!
158 //! \return wchar_t File format as string
159 typedef wchar_t* ( *CheckFileFormatStringFunction )( const wchar_t* inInputFile );
160 
161 //! \brief Checks the version of the specified input file.
162 //!
163 //! If the license allows, the version string is returned in \p outVersion.
164 //! The caller is responsible for allocating and freeing \p outVersion.
165 //!
166 //! \param[in] inInputFile Path to the input file to check
167 //! \param[out] outVersion Pointer that will receive the detected version string
168 //!
169 //! \return int Error code: 0 on success, non-zero on failure (see errors above)
170 typedef int ( *CheckFileVersionFunction )( const wchar_t* inInputFile, wchar_t** outVersion );
171 
172 //! \deprecated use _dtkCheckFileVersion
173 typedef int ( *CheckFileVersionFunctionA )( const wchar_t* inInputFile, char** outVersion );
174 
175 //End_MainFunctions
176 
177 //AssmFunctions
178 
179 //! \brief Returns the list of children for the specified assembly file.
180 //!
181 //! This function analyzes the specified assembly file and retrieves the list
182 //! of child file paths (parts, sub-assemblies, etc.) referenced within it.
183 //!
184 //! \param[in] inFileName Path to the assembly file to process
185 //! \param[out] outChildren Array of wide string pointers containing the child file paths,
186 //! including both the successfully found files and the missing ones.
187 //! Memory for this array is allocated inside the function and must
188 //! be released by the caller (each string + the array itself).
189 //! \param[out] outChildrenCount Number of child file paths returned in outChildren
190 //! \param[in] inSchemaDirectory Path to the schema directory (optional, may be required for certain formats)
191 //! \param[in] inSerial Customer key ID provided by Datakit (optional, may be null)
192 //! \param[in] inSerialTest Test customer key ID provided by Datakit (optional, may be null)
193 //!
194 //! \return Error code indicating the result of the operation
195 //! (0 for success, non-zero for failure)
196 typedef int ( *FindAssemblyChildrenFunction )(
197  const wchar_t* inMyFile,
198  wchar_t**& outChildren,
199  size_t& outChildrenCount,
200  const wchar_t* inMySchemaDir,
201  wchar_t* inClientId,
202  wchar_t* inTestClientId );
203 
204 //! \brief Returns the list of root assembly files found in the specified directory.
205 //!
206 //! This function scans the given directory and identifies all root assembly files
207 //! present within it. A root assembly is defined as a top-level assembly file that
208 //! is not referenced as a child of any other assembly in the same directory.
209 //!
210 //! \param[in] inDirectory Path to the directory to scan for root assemblies.
211 //! \param[out] outChildren Array of wide string pointers containing the full paths
212 //! to the detected root assembly files. Memory for this array
213 //! and for each string is allocated inside the function and
214 //! must be released by the caller (each string + the array itself).
215 //! \param[out] outChildrenCount Number of root assembly file paths returned in outChildren.
216 //! \param[in] inSchemaDirectory Path to the schema directory (optional, may be required for certain formats).
217 //! \param[in] inSerial Customer key ID provided by Datakit (optional, may be null).
218 //! \param[in] inSerialTest Test customer key ID provided by Datakit (optional, may be null).
219 //!
220 //! \return Error code indicating the result of the operation
221 //! (0 for success, non-zero for failure).
222 typedef int ( *FindRootAssembliesFunction )(
223  const wchar_t* inDirectory,
224  wchar_t**& outChildren,
225  size_t& outChildrenCount,
226  const wchar_t* inSchemaDirectory,
227  wchar_t* inSerial,
228  wchar_t* inSerialTest );
229 
230 //End_AssmFunctions
231 
232 #endif