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