From eb39eeb30bce62cbf2ecbd89169c1bc92c75064b Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 25 Jul 2014 18:03:40 -0300 Subject: [PATCH] Added a function to add a new entity without inserting it into the ifc file --- src/ifcwrap/ifc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ifcwrap/ifc.py b/src/ifcwrap/ifc.py index 72837b2ea0..c179472a29 100644 --- a/src/ifcwrap/ifc.py +++ b/src/ifcwrap/ifc.py @@ -103,6 +103,13 @@ def create_shape(inst, settings): return ifc_wrapper.create_shape(inst.wrapped_d def clean(): return ifc_wrapper.clean() +def create_entity(type,*args,**kwargs): + e = entity_instance(ifc_wrapper.entity_instance(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 + return e + DISABLE_OPENING_SUBTRACTIONS = ifc_wrapper.DISABLE_OPENING_SUBTRACTIONS DISABLE_OBJECT_PLACEMENT = ifc_wrapper.DISABLE_OBJECT_PLACEMENT SEW_SHELLS = ifc_wrapper.SEW_SHELLS