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