mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 11:24:19 +00:00
New ifcopenshell.api.run syntax, and rename create_product to create_entity. See #1399.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import importlib
|
||||
import ifcopenshell.api
|
||||
|
||||
|
||||
def run(usecase_path, ifc_file=None, **settings):
|
||||
importlib.import_module(f"ifcopenshell.api.{usecase_path}")
|
||||
module, usecase = usecase_path.split(".")
|
||||
usecase_class = getattr(getattr(getattr(ifcopenshell.api, module), usecase), "Usecase")
|
||||
if ifc_file:
|
||||
return usecase_class(ifc_file, **settings).execute()
|
||||
return usecase_class(**settings).execute()
|
||||
Reference in New Issue
Block a user