Update I could make the IFC export work but still no sucess with import,
Hi,
I'm trying to write a python script to automate IFC import and export tasks, but I can't quite make it work.
I checked the ExportImportInteractor example where there supposed to be example for these kind of processes, and the DWG import and export works perfectly, but there is no example for ifc import, and the IFC export doesn't generate any output, nor any error message.
This is the code that I'm trying to run for export:
def ExportIFC(exportPath): drawingFileService = AllplanBaseElements.DrawingFileService() activeFileIndex = AllplanBaseElements.DrawingFileService.GetActiveFileNumber() doc = AllplanIFW.InputViewDocumentData().GetInputViewDocument() ifcVersion = AllplanBaseElements.Ifc_4 drawingFileService.ExportIFC(doc, [activeFileIndex], ifcVersion, exportPath)
and this is the import
def ImportIFC (importPath ): drawingFileService = AllplanBaseElements.DrawingFileService() doc = AllplanIFW.InputViewDocumentData().GetInputViewDocument() activeFileIndex = AllplanBaseElements.DrawingFileService.GetActiveFileNumber() drawingFileService.UnloadAll(doc) drawingFileService.LoadFile(doc, activeFileIndex, AllplanBaseElements.DrawingFileLoadState.ActiveForeground) ifcVersion = AllplanBaseElements.Ifc_4 drawingFileService.ImportIFC(doc,ifcVersion, importPath)
Did I miss a step somewhere in the code?
Is there any prerequisites for the ExportImportInteractor to work with IFC ?