mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 21:06:25 +00:00
typing
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user