This commit is contained in:
Andrej730
2024-04-26 15:14:00 +05:00
parent 344cc1fb7d
commit 31d85b715a
10 changed files with 75 additions and 33 deletions
+2 -2
View File
@@ -223,7 +223,7 @@ def redo_post(scene):
tool.Ifc.rebuild_element_maps()
def get_application(ifc):
def get_application(ifc: ifcopenshell.file) -> ifcopenshell.entity_instance:
# TODO: cache this for even faster application retrieval. It honestly makes a difference on long scripts.
version = get_application_version()
for element in ifc.by_type("IfcApplication"):
@@ -238,7 +238,7 @@ def get_application(ifc):
)
def get_application_version():
def get_application_version() -> str:
return ".".join(
[
str(x)
+3 -1
View File
@@ -19,6 +19,8 @@
import bpy
import blenderbim.core.tool
import blenderbim.tool as tool
import ifcopenshell
from typing import Union
class Owner(blenderbim.core.tool.Owner):
@@ -27,7 +29,7 @@ class Owner(blenderbim.core.tool.Owner):
bpy.context.scene.BIMOwnerProperties.active_user_id = user.id()
@classmethod
def get_user(cls):
def get_user(cls) -> Union[ifcopenshell.entity_instance, None]:
if bpy.context.scene.BIMOwnerProperties.active_user_id:
return tool.Ifc.get().by_id(bpy.context.scene.BIMOwnerProperties.active_user_id)
elif tool.Ifc.get_schema() == "IFC2X3":