CrossManager CLI Help  V2026.3
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 #ifdef _MSC_VER
61 #define EXPORT_DEF __declspec(dllexport)
62 #else
63 #define EXPORT_DEF
64 #endif
65 
66 ///! \brief Callback function to monitor the progress of a file conversion
67 //!
68 //! \param[in] inProgressBarNumber Progress bar ID
69 //! \param[in] inPercent Current progress percentage
70 typedef void( *Progress_dtk ) ( int* inProgressBarNumber, int* inPercent );
71 
72 //MainFunctions
73 
74 //! \brief Returns the version number of CrossCadWare.dll
75 //!
76 //! \return int Version number of CrossCadWare.dll
77 extern "C" int EXPORT_DEF _dtkGetVersion();
78 
79 //! \brief Returns the release number of CrossCadWare.dll
80 //!
81 //! \return int Release number of CrossCadWare.dll
82 extern "C" int EXPORT_DEF _dtkGetRelease();
83 
84 //! \brief Converts an input file to the requested output format.
85 //!
86 //! Uses the Datakit/CrossCadWare libraries and the provided configuration file.
87 //!
88 //! \param[in] inInputFormat File type to read (see supported formats defined above)
89 //! \param[in] inOutputFormat File type to write (see supported formats defined above)
90 //! \param[in] inInputFile Path to the input file to read
91 //! \param[in] inOutputFile Path to the output file to write
92 //! \param[in] inConfigFile Path to the configuration file (use the config file delivered with the DLL to ensure proper options are selected)
93 //! \param[in] inSchemaDirectory Path to the Parasolid schema directory, or NULL (required for Unigraphics/NX, SolidWorks, Parasolid, Solid Edge files)
94 //! \param[in] inProgressBarFunction Progress callback function or NULL (see Progress_dtk() declaration above)
95 //! \param[in] inRemoveProgressDialogBoxes Set to 1 to suppress dialog boxes, 0 to allow them
96 //! \param[in] inSerial Customer key ID provided by Datakit, or NULL
97 //! \param[in] inFutureUse0 Reserved for future use — set to 0
98 //! \param[in] inFutureUse1 Reserved for future use
99 //! \param[in] inFutureUse2 Reserved for future use
100 //! \param[in] inFutureUse3 Reserved for future use
101 //! \param[in] inSerialTest Test customer key ID provided by Datakit, or NULL
102 //!
103 //! \return int Error code: 0 on success, non-zero on failure (see errors below)
104 extern "C" int EXPORT_DEF _dtkConvert20(
105  int inInputFormat,
106  int inOutputFormat,
107  wchar_t* inInputFile,
108  wchar_t* inOutputFile,
109  wchar_t* inConfigFile,
110  wchar_t* inSchemaDirectory,
111  Progress_dtk inProgressBarFunction,
112  int inRemoveProgressDialogBoxes,
113  wchar_t* inSerial,
114  int inFutureUse0,
115  int inFutureUse1,
116  int inFutureUse2,
117  int inFutureUse3,
118  wchar_t* inSerialTest );
119 
120 //ErrorDefinitions
121 
122 // dtkWarningInvalidArgument = -1010, // File extension and file format do not match
123 // dtkErrorUnspecified = -1001, // Unspecified error
124 // dtkErrorTypeNotSupported = -1000, // File format invalid or not supported
125 // dtkWarningNoEntitiesWritten = -32, // No entities were written to the output file
126 // dtkErrorFileNotExist = -28, // Input file does not exist
127 // dtkErrorVersionNotSupported = -27, // File version not supported
128 // dtkErrorOpenOutputFile = -23, // Cannot open output file
129 // dtkErrorOpenInputFile = -22, // Cannot open input file
130 // dtkErrorSchemaNotFound = -15, // Missing Schema file
131 // dtkErrorOpenConfigFile = -13, // Cannot open configuration file
132 // dtkErrorOutputFile = -6, // Output file error
133 // dtkErrorInputFile = -5, // Input file error
134 // dtkErrorLicence = -4, // License error
135 // dtkErrorLicenceCmd = -44, // License error
136 // dtkErrorOpenFiles = -2, // Cannot open files
137 // dtkErrorAllocation = -1, // Memory allocation error
138 // dtkNoError = 0, // No error (success)
139 // dtkErrorUserBreak = 1, // Conversion aborted by user
140 
141 //End_ErrorDefinitions
142 
143 //! \brief Returns the file format code corresponding to the predefined constants.
144 //!
145 //! This function checks the input file and returns the matching format code (see formats defined above)
146 //! If the format is unknown, the function returns 0.
147 //!
148 //! \return int Format code of the file, or 0 if unknown
149 extern "C" int EXPORT_DEF _dtkCheckFormat( const wchar_t* inInputFile );
150 
151 //! \brief Returns the file format code corresponding to the predefined constants.
152 //!
153 //! This function checks the input file and returns the matching format code (see formats defined above)
154 //! If the format is unknown, the function returns 0.
155 //!
156 //! \return int Format code of the file, or 0 if unknown
157 extern "C" int EXPORT_DEF dtkCheckFormat( const char* inInputFile );
158 
159 //! \brief Returns the file format as a string.
160 //!
161 //! This function retrieves the format of the given file
162 //! and returns it as a human-readable string.
163 //!
164 //! \return wchar_t File format as string
165 extern "C" wchar_t EXPORT_DEF* _dtkCheckFormatString( const wchar_t* inInputFile );
166 
167 //! \brief Checks the version of the specified input file.
168 //!
169 //! If the license allows, the version string is returned in \p outVersion.
170 //! The caller is responsible for allocating and freeing \p outVersion.
171 //!
172 //! \param[in] inInputFile Path to the input file to check
173 //! \param[out] outVersion Pointer that will receive the detected version string
174 //!
175 //! \return int Error code: 0 on success, non-zero on failure (see errors above)
176 extern "C" int EXPORT_DEF _dtkCheckFileVersion( const wchar_t* inInputFile, wchar_t** outVersion );
177 
178 //! \deprecated use _dtkCheckFileVersion
179 extern "C" int EXPORT_DEF _dtkCheckVersion( const wchar_t* inInputFile, char** outVersion );
180 
181 //! \brief Returns a string description (outError) corresponding to the given error number.
182 //!
183 //! \param[in] errNumber Error code (see errors defined above)
184 //! \param[out] outError Pointer that will receive the error description string
185 //!
186 //! \return int Error code: 0 on success, non-zero on failure
187 extern "C" int EXPORT_DEF _dtkTypeError( int errNumber, wchar_t** outError );
188 
189 //End_MainFunctions
190 
191 //AdditionnalFunctions
192 
193 //! \brief Checks if a FlexLM converter license is available.
194 //!
195 //! \param[in] inInputFlexlmProductName Name of the FlexLM product to check
196 //! \return int 0 if the license is available, non-zero error code otherwise
197 extern "C" int EXPORT_DEF _dtkTestFlexlmProduct( char* inInputFlexlmProductName );
198 
199 //End_AdditionnalFunctions
200 
201 //AssmFunctions
202 
203 //! \brief Returns the list of children for the specified assembly file.
204 //!
205 //! This function analyzes the specified assembly file and retrieves the list
206 //! of child file paths (parts, sub-assemblies, etc.) referenced within it.
207 //!
208 //! \param[in] inFileName Path to the assembly file to process
209 //! \param[out] outChildren Array of wide string pointers containing the child file paths,
210 //! including both the successfully found files and the missing ones.
211 //! Memory for this array is allocated inside the function and must
212 //! be released by the caller (each string + the array itself).
213 //! \param[out] outChildrenCount Number of child file paths returned in outChildren
214 //! \param[in] inSchemaDirectory Path to the schema directory (optional, may be required for certain formats)
215 //! \param[in] inSerial Customer key ID provided by Datakit (optional, may be null)
216 //! \param[in] inSerialTest Test customer key ID provided by Datakit (optional, may be null)
217 //!
218 //! \return Error code indicating the result of the operation
219 //! (0 for success, non-zero for failure)
220 extern "C" EXPORT_DEF int _FindAssemblyChildren(
221  const wchar_t* inFileName,
222  wchar_t**& outChildren,
223  size_t& outChildrenCount,
224  const wchar_t* inSchemaDirectory,
225  wchar_t* inSerial,
226  wchar_t* inSerialTest );
227 
228 //! \brief Returns the list of root assembly files found in the specified directory.
229 //!
230 //! This function scans the given directory and identifies all root assembly files
231 //! present within it. A root assembly is defined as a top-level assembly file that
232 //! is not referenced as a child of any other assembly in the same directory.
233 //!
234 //! \param[in] inDirectory Path to the directory to scan for root assemblies.
235 //! \param[out] outChildren Array of wide string pointers containing the full paths
236 //! to the detected root assembly files. Memory for this array
237 //! and for each string is allocated inside the function and
238 //! must be released by the caller (each string + the array itself).
239 //! \param[out] outChildrenCount Number of root assembly file paths returned in outChildren.
240 //! \param[in] inSchemaDirectory Path to the schema directory (optional, may be required for certain formats).
241 //! \param[in] inSerial Customer key ID provided by Datakit (optional, may be null).
242 //! \param[in] inSerialTest Test customer key ID provided by Datakit (optional, may be null).
243 //!
244 //! \return Error code indicating the result of the operation
245 //! (0 for success, non-zero for failure).
246 extern "C" EXPORT_DEF int _FindRootAssemblies(
247  const wchar_t* inDirectory,
248  wchar_t**& outChildren,
249  size_t& outChildrenCount,
250  const wchar_t* inSchemaDirectory,
251  wchar_t* inSerial,
252  wchar_t* inSerialTest );
253 
254 //End_AssmFunctions
255 
256 #undef EXPORT_DEF
257 
258 #endif