mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Optimise owner check depending on your implementation and no longer create default users on IFC4. Can result in 50% faster script running on long scripted operations.
This commit is contained in:
@@ -12,10 +12,11 @@ class Usecase:
|
||||
|
||||
def execute(self):
|
||||
user = ifcopenshell.api.owner.settings.get_user(self.file)
|
||||
if self.file.schema != "IFC2X3" and not user:
|
||||
return
|
||||
application = ifcopenshell.api.owner.settings.get_application(self.file)
|
||||
if self.file.schema != "IFC2X3":
|
||||
if not user or not application:
|
||||
return
|
||||
if self.file.schema != "IFC2X3" and not application:
|
||||
return
|
||||
return self.file.create_entity(
|
||||
"IfcOwnerHistory",
|
||||
**{
|
||||
|
||||
@@ -15,8 +15,10 @@ class Usecase:
|
||||
if not hasattr(self.settings["element"], "OwnerHistory"):
|
||||
return
|
||||
user = ifcopenshell.api.owner.settings.get_user(self.file)
|
||||
if not user:
|
||||
return
|
||||
application = ifcopenshell.api.owner.settings.get_application(self.file)
|
||||
if not user or not application:
|
||||
if not application:
|
||||
return
|
||||
if not self.settings["element"].OwnerHistory:
|
||||
self.settings["element"].OwnerHistory = ifcopenshell.api.run(
|
||||
|
||||
Reference in New Issue
Block a user