diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index 582559230a..db5f91519b 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -63,8 +63,8 @@ def open(fn): raise IOError("Unable to open file for reading") -def create_entity(type, *args, **kwargs): - e = entity_instance(type) +def create_entity(type, *args, schema='IFC4', **kwargs): + e = entity_instance((schema, type)) attrs = list(enumerate(args)) + [(e.wrapped_data.get_argument_index(name), arg) for name, arg in kwargs.items()] for idx, arg in attrs: e[idx] = arg