[BlenderBIM] Export IFC using BlenderBIM, but only selected objects?

edited March 2023 in General

Hi,
I was looking at the code shown here:
"https://wiki.osarch.org/index.php?title=BlenderBIM_Add-on/BlenderBIM_Add-on_code_examples".
The below code (from the link above) is (I think) supposed to export an ifc but only the selected objects. I guess there has been updates since this example, I am atleast not able to make it work. Does anyone know how to export only the selected objects?

import bpy
import logging
import blenderbim.bim.export_ifc
import blenderbim.bim.qto
settings = blenderbim.bim.export_ifc.IfcExportSettings.factory(bpy.context, '/home/dion/testa.ifc', logging.getLogger('ExportIFC'))
qto_calculator = blenderbim.bim.qto.QtoCalculator()
ifc_parser = blenderbim.bim.export_ifc.IfcParser(settings, qto_calculator)
ifc_exporter = blenderbim.bim.export_ifc.IfcExporter(settings, ifc_parser)
ifc_exporter.export(bpy.context.selected_objects)

Comments

Sign In or Register to comment.