0

I am using a library called "spatial" for converting CAD files from one format to another. The sample code provided by spatial for conversion seems to convert all other files except .CATPart and .CATProduct file format of CATIAV5. Below sample code can convert all other formats like .igs,.sat,.stp,.stl files but cannot convert .CATPart files.

However in the documentation of the library, https://doc.spatial.com/get_doc_page/articles/c/o/n/InterOp~Connect_Translation_Basics_e88d.html , it is clearly stated that it can convert the .CATPart file too.

The simple conversion code is as below:

#include "SPAIConverter.h"
#include "SPAIDocument.h"
#include "SPAISystemInitGuard.h" 
#include "SPAIFile.h"

int main()
{
  SPAISystemInitGuard initGuard;
  SPAIDocument src( L"C:\\model.CATPart" );
  SPAIDocument dst( L"C:\\model.sat" );

  SPAIFile console(1);
  SPAIConverter converter;

  converter.StartLog(console);
  converter.Convert(src, dst);
  converter.StopLog(console);
  return 0;
}

When I try to convert the .CATPart file, it gives me following error:

Warning : Input file-path seems to have unsupported characters.
Warning : Trying with windows 8dot3 short file-name to open the file.

Error : Failed to open C:\model.CATPart

I really appreciate the help. Thank you in advance.

1 Answers1

0

you have 2 '\' next to each other in the filepath which is not valid for windows.

tink
  • 11
  • 5