This commit is contained in:
Andrej730
2024-04-15 11:24:25 +05:00
parent 919dcbe2d9
commit 0a9c9f2a28
2 changed files with 4 additions and 2 deletions
@@ -20,6 +20,7 @@ import bpy
import json import json
import ifcopenshell import ifcopenshell
import ifcopenshell.api import ifcopenshell.api
import ifcopenshell.util.element
import blenderbim.tool as tool import blenderbim.tool as tool
import blenderbim.bim.helper import blenderbim.bim.helper
from blenderbim.bim.ifc import IfcStore from blenderbim.bim.ifc import IfcStore
@@ -19,10 +19,11 @@
import ifcopenshell import ifcopenshell
import ifcopenshell.util.schema import ifcopenshell.util.schema
import ifcopenshell.util.date import ifcopenshell.util.date
from typing import Union
class Usecase: class Usecase:
def __init__(self, file, classification=None): def __init__(self, file: ifcopenshell.file, classification: Union[str, ifcopenshell.entity_instance]):
"""Adds a new classification system to the project """Adds a new classification system to the project
External classification systems such as Uniclass or Omniclass are External classification systems such as Uniclass or Omniclass are
@@ -81,7 +82,7 @@ class Usecase:
"classification": classification, "classification": classification,
} }
def execute(self): def execute(self) -> ifcopenshell.entity_instance:
if isinstance(self.settings["classification"], str): if isinstance(self.settings["classification"], str):
classification = self.file.createIfcClassification(Name=self.settings["classification"]) classification = self.file.createIfcClassification(Name=self.settings["classification"])
self.relate_to_project(classification) self.relate_to_project(classification)