[IfcOpneShell]Unabled to add instance from IFC2X3 schema to file with IFC4 schema

100 views Asked by At

I am using IfcOpenShell in python. When I try to createed a new file and added entity, I get the following error. How can I get rid of the error? [program]

ifc_file = ifcopenshell.file()
ifc_file.add({IfcBuildingElementProxy})

[error]

Unabled to add instance from IFC2X3 schema to file with IFC4 schema

Thanks for any help.

1

There are 1 answers

0
Amicry On

I found my own answer. I had to set 'schema'

ifc_file = ifcopenshell.file(schema=other_ifc_file.schema)
ifc_file.add({IfcBuildingElementProxy})