Code: Select all
sys.path.append("/usr/lib/freecad/lib")
import FreeCAD
FreeCAD.loadFile("Test.stp")
Code: Select all
"OSError: Filetype stp is not supported."
When I execute the code within the freecadcmd prompt, everything works perfectly.
I checked my sys.path which contains the freecad links
Code: Select all
'/usr/lib/freecad-python3/Mod', '/usr/lib/freecad-python3/lib', '/usr/lib/freecad-python3/Ext'
In python I get:
Code: Select all
>>> FreeCAD.getImportType()
{'FCStd': 'FreeCAD'}
Code: Select all
>>> FreeCAD.getImportType()
{'3ds': 'import3DS', 'FCMat': 'importFCMat', 'FCStd': 'FreeCAD', 'asc': 'Points', 'ast': 'Mesh', 'bdf': 'Fem', 'bms': 'Mesh', 'brep': 'Part', 'brp': 'Part', 'csg': 'importCSG', 'dae': 'importDAE', 'dat': ['importAirfoilDAT', 'Fem'], 'dwg': 'importDWG', 'dxf': 'importDXF', 'emn': 'Idf', 'frd': 'feminout.importCcxFrdResults', 'gcad': 'importOCA', 'ifc': 'importIFC', 'iges': 'Part', 'igs': 'Part', 'inp': 'Fem', 'json': 'feminout.importYamlJsonMesh', 'med': 'Fem', 'meshjson': 'feminout.importYamlJsonMesh', 'meshyaml': 'feminout.importYamlJsonMesh', 'obj': ['importOBJ', 'Mesh'], 'oca': 'importOCA', 'off': 'Mesh', 'pcd': 'Points', 'plmxml': 'PlmXmlParser', 'ply': ['Mesh', 'Points'], 'shp': 'importSHP', 'smf': 'Mesh', 'step': 'Import', 'stl': 'Mesh', 'stp': 'Import', 'stpZ': ['stepZ', 'stepZ'], 'stpz': ['stepZ', 'stepZ'], 'svg': 'importSVG', 'unv': 'Fem', 'vtk': ['Fem', 'feminout.importVTKResults'], 'vtu': ['Fem', 'feminout.importVTKResults'], 'xdmf': 'feminout.importFenicsMesh', 'xlsx': 'importXLSX', 'xml': 'feminout.importFenicsMesh', 'yaml': 'feminout.importYamlJsonMesh', 'z88': 'Fem', 'zip': 'importSH3D'}
Any idea of what is happening ? I checked similar topics on the forum but it is not clear to me what is the fix.