mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 06:21:40 +00:00
typing
This commit is contained in:
@@ -170,7 +170,8 @@ def import_attribute(
|
|||||||
if isinstance(data_type, tuple) or data_type == "entity":
|
if isinstance(data_type, tuple) or data_type == "entity":
|
||||||
callback(attribute.name(), None, data) if callback else None
|
callback(attribute.name(), None, data) if callback else None
|
||||||
return
|
return
|
||||||
new: bonsai.bim.prop.Attribute = props.add()
|
|
||||||
|
new = props.add()
|
||||||
new.name = attribute.name()
|
new.name = attribute.name()
|
||||||
new.is_null = data[attribute.name()] is None
|
new.is_null = data[attribute.name()] is None
|
||||||
new.is_optional = attribute.optional()
|
new.is_optional = attribute.optional()
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class LoadGroups(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
bpy.ops.bim.disable_editing_group()
|
bpy.ops.bim.disable_editing_group()
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
def load_group(self, group, tree_depth=0):
|
def load_group(self, group: ifcopenshell.entity_instance, tree_depth: int = 0) -> None:
|
||||||
new = self.props.groups.add()
|
new = self.props.groups.add()
|
||||||
new.ifc_definition_id = group.id()
|
new.ifc_definition_id = group.id()
|
||||||
new.name = group.Name or "Unnamed"
|
new.name = group.Name or "Unnamed"
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class BIM_UL_groups(UIList):
|
|||||||
active_data,
|
active_data,
|
||||||
active_propname,
|
active_propname,
|
||||||
index: int,
|
index: int,
|
||||||
):
|
) -> None:
|
||||||
if item:
|
if item:
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
for i in range(0, item.tree_depth):
|
for i in range(0, item.tree_depth):
|
||||||
|
|||||||
@@ -103,19 +103,19 @@ def get_pset_name(self: "PsetProperties", context: bpy.types.Context) -> tool.Bl
|
|||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
||||||
def get_object_pset_name(self, context):
|
def get_object_pset_name(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
if not ObjectPsetsData.is_loaded:
|
if not ObjectPsetsData.is_loaded:
|
||||||
ObjectPsetsData.load()
|
ObjectPsetsData.load()
|
||||||
return ObjectPsetsData.data["pset_name"]
|
return ObjectPsetsData.data["pset_name"]
|
||||||
|
|
||||||
|
|
||||||
def get_material_pset_names(self, context):
|
def get_material_pset_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
if not MaterialPsetsData.is_loaded:
|
if not MaterialPsetsData.is_loaded:
|
||||||
MaterialPsetsData.load()
|
MaterialPsetsData.load()
|
||||||
return MaterialPsetsData.data["pset_name"]
|
return MaterialPsetsData.data["pset_name"]
|
||||||
|
|
||||||
|
|
||||||
def get_material_set_pset_names(self, context):
|
def get_material_set_pset_names(self: "PsetProperties", context: object):
|
||||||
global psetnames
|
global psetnames
|
||||||
if not ObjectMaterialData.is_loaded:
|
if not ObjectMaterialData.is_loaded:
|
||||||
ObjectMaterialData.load()
|
ObjectMaterialData.load()
|
||||||
@@ -128,7 +128,7 @@ def get_material_set_pset_names(self, context):
|
|||||||
return psetnames[ifc_class]
|
return psetnames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_material_set_item_pset_names(self, context) -> list[tuple[str, str, str]]:
|
def get_material_set_item_pset_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global psetnames
|
global psetnames
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
assert obj
|
assert obj
|
||||||
@@ -142,7 +142,7 @@ def get_material_set_item_pset_names(self, context) -> list[tuple[str, str, str]
|
|||||||
return psetnames[ifc_class]
|
return psetnames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_task_qto_names(self, context):
|
def get_task_qto_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global qtonames
|
global qtonames
|
||||||
ifc_class = "IfcTask"
|
ifc_class = "IfcTask"
|
||||||
if ifc_class not in qtonames:
|
if ifc_class not in qtonames:
|
||||||
@@ -151,7 +151,7 @@ def get_task_qto_names(self, context):
|
|||||||
return qtonames[ifc_class]
|
return qtonames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_resource_pset_names(self, context):
|
def get_resource_pset_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global psetnames
|
global psetnames
|
||||||
rprops = context.scene.BIMResourceProperties
|
rprops = context.scene.BIMResourceProperties
|
||||||
rtprops = context.scene.BIMResourceTreeProperties
|
rtprops = context.scene.BIMResourceTreeProperties
|
||||||
@@ -162,7 +162,7 @@ def get_resource_pset_names(self, context):
|
|||||||
return psetnames[ifc_class]
|
return psetnames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_resource_qto_names(self, context):
|
def get_resource_qto_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global qtonames
|
global qtonames
|
||||||
rprops = context.scene.BIMResourceProperties
|
rprops = context.scene.BIMResourceProperties
|
||||||
rtprops = context.scene.BIMResourceTreeProperties
|
rtprops = context.scene.BIMResourceTreeProperties
|
||||||
@@ -173,7 +173,7 @@ def get_resource_qto_names(self, context):
|
|||||||
return qtonames[ifc_class]
|
return qtonames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_group_pset_names(self, context):
|
def get_group_pset_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global psetnames
|
global psetnames
|
||||||
ifc_class = "IfcGroup"
|
ifc_class = "IfcGroup"
|
||||||
if ifc_class not in psetnames:
|
if ifc_class not in psetnames:
|
||||||
@@ -182,7 +182,7 @@ def get_group_pset_names(self, context):
|
|||||||
return psetnames[ifc_class]
|
return psetnames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_group_qto_names(self, context):
|
def get_group_qto_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global qtonames
|
global qtonames
|
||||||
ifc_class = "IfcGroup"
|
ifc_class = "IfcGroup"
|
||||||
if ifc_class not in qtonames:
|
if ifc_class not in qtonames:
|
||||||
@@ -191,7 +191,7 @@ def get_group_qto_names(self, context):
|
|||||||
return qtonames[ifc_class]
|
return qtonames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_profile_pset_names(self, context):
|
def get_profile_pset_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global psetnames
|
global psetnames
|
||||||
pprops = tool.Profile.get_profile_props()
|
pprops = tool.Profile.get_profile_props()
|
||||||
ifc_class = tool.Ifc.get().by_id(pprops.profiles[pprops.active_profile_index].ifc_definition_id).is_a()
|
ifc_class = tool.Ifc.get().by_id(pprops.profiles[pprops.active_profile_index].ifc_definition_id).is_a()
|
||||||
@@ -201,7 +201,7 @@ def get_profile_pset_names(self, context):
|
|||||||
return psetnames[ifc_class]
|
return psetnames[ifc_class]
|
||||||
|
|
||||||
|
|
||||||
def get_work_schedule_pset_names(self, context):
|
def get_work_schedule_pset_names(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
global psetnames
|
global psetnames
|
||||||
ifc_class = "IfcWorkSchedule"
|
ifc_class = "IfcWorkSchedule"
|
||||||
if ifc_class not in psetnames:
|
if ifc_class not in psetnames:
|
||||||
@@ -211,7 +211,7 @@ def get_work_schedule_pset_names(self, context):
|
|||||||
|
|
||||||
|
|
||||||
# TODO: unsafe?
|
# TODO: unsafe?
|
||||||
def get_qto_name(self, context):
|
def get_qto_name(self: "PsetProperties", context: bpy.types.Context) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
pset_type = repr(self)
|
pset_type = repr(self)
|
||||||
prop_type = pset_type.split(".")[-1]
|
prop_type = pset_type.split(".")[-1]
|
||||||
if "bpy.data.objects" in pset_type:
|
if "bpy.data.objects" in pset_type:
|
||||||
@@ -226,21 +226,21 @@ def get_qto_name(self, context):
|
|||||||
return [("BBIM_CUSTOM", "Custom Qto", "Create a quantity set without using a template."), None] + results
|
return [("BBIM_CUSTOM", "Custom Qto", "Create a quantity set without using a template."), None] + results
|
||||||
|
|
||||||
|
|
||||||
def get_object_qto_name(self, context):
|
def get_object_qto_name(self: "PsetProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
if not ObjectPsetsData.is_loaded:
|
if not ObjectPsetsData.is_loaded:
|
||||||
ObjectPsetsData.load()
|
ObjectPsetsData.load()
|
||||||
return ObjectPsetsData.data["qto_name"]
|
return ObjectPsetsData.data["qto_name"]
|
||||||
|
|
||||||
|
|
||||||
# TODO: unsafe?
|
# TODO: unsafe?
|
||||||
def get_template_type(self, context):
|
def get_template_type(self: "AddEditProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
version = tool.Ifc.get_schema()
|
version = tool.Ifc.get_schema()
|
||||||
for t in ("IfcPropertySingleValue", "IfcPropertyEnumeratedValue"):
|
for t in ("IfcPropertySingleValue", "IfcPropertyEnumeratedValue"):
|
||||||
yield (t, t, ifcopenshell.util.doc.get_entity_doc(version, t).get("description", ""))
|
yield (t, t, ifcopenshell.util.doc.get_entity_doc(version, t).get("description", ""))
|
||||||
|
|
||||||
|
|
||||||
# TODO: unsafe?
|
# TODO: unsafe?
|
||||||
def get_primary_measure_type(self, context):
|
def get_primary_measure_type(self: "AddEditProperties", context: object) -> tool.Blender.BLENDER_ENUM_ITEMS:
|
||||||
if not AddEditCustomPropertiesData.is_loaded:
|
if not AddEditCustomPropertiesData.is_loaded:
|
||||||
AddEditCustomPropertiesData.load()
|
AddEditCustomPropertiesData.load()
|
||||||
return AddEditCustomPropertiesData.data["primary_measure_type"]
|
return AddEditCustomPropertiesData.data["primary_measure_type"]
|
||||||
@@ -249,6 +249,9 @@ def get_primary_measure_type(self, context):
|
|||||||
class IfcPropertyEnumeratedValue(PropertyGroup):
|
class IfcPropertyEnumeratedValue(PropertyGroup):
|
||||||
enumerated_values: CollectionProperty(type=Attribute)
|
enumerated_values: CollectionProperty(type=Attribute)
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
enumerated_values: bpy.types.bpy_prop_collection_idprop[Attribute]
|
||||||
|
|
||||||
|
|
||||||
IfcPropertyValueType = Literal["IfcPropertySingleValue", "IfcPropertyEnumeratedValue"]
|
IfcPropertyValueType = Literal["IfcPropertySingleValue", "IfcPropertyEnumeratedValue"]
|
||||||
|
|
||||||
@@ -297,6 +300,11 @@ class RenameProperties(PropertyGroup):
|
|||||||
existing_property_name: StringProperty(name="Existing Property Name")
|
existing_property_name: StringProperty(name="Existing Property Name")
|
||||||
new_property_name: StringProperty(name="New Property Name")
|
new_property_name: StringProperty(name="New Property Name")
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
pset_name: str
|
||||||
|
existing_property_name: str
|
||||||
|
new_property_name: str
|
||||||
|
|
||||||
|
|
||||||
class AddEditProperties(PropertyGroup):
|
class AddEditProperties(PropertyGroup):
|
||||||
pset_name: StringProperty(name="Pset")
|
pset_name: StringProperty(name="Pset")
|
||||||
@@ -309,6 +317,17 @@ class AddEditProperties(PropertyGroup):
|
|||||||
template_type: EnumProperty(items=get_template_type, name="Template Type")
|
template_type: EnumProperty(items=get_template_type, name="Template Type")
|
||||||
enum_values: CollectionProperty(name="Enum Values", type=Attribute)
|
enum_values: CollectionProperty(name="Enum Values", type=Attribute)
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
pset_name: str
|
||||||
|
property_name: str
|
||||||
|
string_value: str
|
||||||
|
bool_value: bool
|
||||||
|
int_value: int
|
||||||
|
float_value: float
|
||||||
|
primary_measure_type: str
|
||||||
|
template_type: str
|
||||||
|
enum_values: bpy.types.bpy_prop_collection_idprop[Attribute]
|
||||||
|
|
||||||
def get_value_name(self) -> Union[Literal["string_value", "bool_value", "int_value", "float_value"], None]:
|
def get_value_name(self) -> Union[Literal["string_value", "bool_value", "int_value", "float_value"], None]:
|
||||||
schema = tool.Ifc.schema()
|
schema = tool.Ifc.schema()
|
||||||
ifc_data_type = schema.declaration_by_name(self.primary_measure_type)
|
ifc_data_type = schema.declaration_by_name(self.primary_measure_type)
|
||||||
@@ -326,7 +345,14 @@ class AddEditProperties(PropertyGroup):
|
|||||||
class DeletePsets(PropertyGroup):
|
class DeletePsets(PropertyGroup):
|
||||||
pset_name: StringProperty(name="Pset")
|
pset_name: StringProperty(name="Pset")
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
pset_name: str
|
||||||
|
|
||||||
|
|
||||||
class GlobalPsetProperties(PropertyGroup):
|
class GlobalPsetProperties(PropertyGroup):
|
||||||
pset_filter: StringProperty(name="Pset Filter", options={"TEXTEDIT_UPDATE"})
|
pset_filter: StringProperty(name="Pset Filter", options={"TEXTEDIT_UPDATE"})
|
||||||
qto_filter: StringProperty(name="Qto Filter", options={"TEXTEDIT_UPDATE"})
|
qto_filter: StringProperty(name="Qto Filter", options={"TEXTEDIT_UPDATE"})
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
pset_filter: str
|
||||||
|
qto_filter: str
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ class Pset(bonsai.core.tool.Pset):
|
|||||||
pset_template: ifcopenshell.entity_instance,
|
pset_template: ifcopenshell.entity_instance,
|
||||||
prop_template: ifcopenshell.entity_instance,
|
prop_template: ifcopenshell.entity_instance,
|
||||||
data: dict[str, Any],
|
data: dict[str, Any],
|
||||||
props: bpy.types.PropertyGroup,
|
props: PsetProperties,
|
||||||
) -> None:
|
) -> None:
|
||||||
prop = props.properties.add()
|
prop = props.properties.add()
|
||||||
prop.name = prop_template.Name
|
prop.name = prop_template.Name
|
||||||
@@ -293,7 +293,7 @@ class Pset(bonsai.core.tool.Pset):
|
|||||||
cls,
|
cls,
|
||||||
pset_template: ifcopenshell.entity_instance,
|
pset_template: ifcopenshell.entity_instance,
|
||||||
pset: Union[ifcopenshell.entity_instance, None],
|
pset: Union[ifcopenshell.entity_instance, None],
|
||||||
props: bpy.types.PropertyGroup,
|
props: PsetProperties,
|
||||||
) -> None:
|
) -> None:
|
||||||
if pset:
|
if pset:
|
||||||
data = ifcopenshell.util.element.get_property_definition(pset, verbose=True)
|
data = ifcopenshell.util.element.get_property_definition(pset, verbose=True)
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ class Usecase:
|
|||||||
else:
|
else:
|
||||||
vx = vz.cross(X_AXIS)
|
vx = vz.cross(X_AXIS)
|
||||||
vy = vx.cross(vz)
|
vy = vx.cross(vz)
|
||||||
|
assert isinstance(vy, Vector)
|
||||||
tM = Matrix(
|
tM = Matrix(
|
||||||
[[vx.x, vy.x, vz.x, co.x], [vx.y, vy.y, vz.y, co.y], [vx.z, vy.z, vz.z, co.z], [0, 0, 0, 1]]
|
[[vx.x, vy.x, vz.x, co.x], [vx.y, vy.y, vz.y, co.y], [vx.z, vy.z, vz.z, co.z], [0, 0, 0, 1]]
|
||||||
).inverted()
|
).inverted()
|
||||||
|
|||||||
@@ -568,6 +568,8 @@ class entity_instance:
|
|||||||
) -> dict[str, Any]:
|
) -> dict[str, Any]:
|
||||||
"""Return a dictionary of the entity_instance's properties (Python and IFC) and their values.
|
"""Return a dictionary of the entity_instance's properties (Python and IFC) and their values.
|
||||||
|
|
||||||
|
Resulting dictionary keys: 'id', 'type', all entity attribute names.
|
||||||
|
|
||||||
:param include_identifier: Whether or not to include the STEP numerical identifier
|
:param include_identifier: Whether or not to include the STEP numerical identifier
|
||||||
:param recursive: Whether or not to convert referenced IFC elements into dictionaries too. All attributes also apply recursively
|
:param recursive: Whether or not to convert referenced IFC elements into dictionaries too. All attributes also apply recursively
|
||||||
:param return_type: The return data type to be casted into
|
:param return_type: The return data type to be casted into
|
||||||
|
|||||||
@@ -584,7 +584,7 @@ class aggregation_type(parameter_type):
|
|||||||
bag_type: Any
|
bag_type: Any
|
||||||
list_type: Any
|
list_type: Any
|
||||||
set_type: Any
|
set_type: Any
|
||||||
def as_aggregation_type(self): ...
|
def as_aggregation_type(self) -> aggregation_type: ...
|
||||||
def bound1(self): ...
|
def bound1(self): ...
|
||||||
def bound2(self): ...
|
def bound2(self): ...
|
||||||
def type_of_aggregation(self): ...
|
def type_of_aggregation(self): ...
|
||||||
@@ -1120,8 +1120,8 @@ class matrix4(item):
|
|||||||
|
|
||||||
class named_type(parameter_type):
|
class named_type(parameter_type):
|
||||||
def _is(self, *args): ...
|
def _is(self, *args): ...
|
||||||
def as_named_type(self): ...
|
def as_named_type(self) -> named_type: ...
|
||||||
def declared_type(self): ...
|
def declared_type(self) -> declaration: ...
|
||||||
|
|
||||||
class node(item):
|
class node(item):
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@@ -1146,10 +1146,16 @@ class offset_function(function_item):
|
|||||||
def start(self): ...
|
def start(self): ...
|
||||||
|
|
||||||
class parameter_type:
|
class parameter_type:
|
||||||
def _is(self, *args): ...
|
def _is(self, *args: Union[str, declaration]) -> bool:
|
||||||
def as_aggregation_type(self): ...
|
"""
|
||||||
def as_named_type(self): ...
|
:param args: IFC class name or declaration to check.
|
||||||
def as_simple_type(self): ...
|
Argument accepts only 1 value.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
||||||
|
def as_aggregation_type(self) -> Union[aggregation_type, None]: ...
|
||||||
|
def as_named_type(self) -> Union[named_type, None]: ...
|
||||||
|
def as_simple_type(self) -> Union[simple_type, None]: ...
|
||||||
|
|
||||||
class piecewise_function(function_item):
|
class piecewise_function(function_item):
|
||||||
def calc_hash(self): ...
|
def calc_hash(self): ...
|
||||||
@@ -1268,7 +1274,7 @@ class simple_type(parameter_type):
|
|||||||
real_type: Any
|
real_type: Any
|
||||||
string_type: Any
|
string_type: Any
|
||||||
datatype_COUNT: Any
|
datatype_COUNT: Any
|
||||||
def as_simple_type(self): ...
|
def as_simple_type(self) -> simple_type: ...
|
||||||
def declared_type(self): ...
|
def declared_type(self): ...
|
||||||
|
|
||||||
class solid:
|
class solid:
|
||||||
|
|||||||
@@ -17,13 +17,22 @@
|
|||||||
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
|
import ifcopenshell.ifcopenshell_wrapper as ifcopenshell_wrapper
|
||||||
from typing import Union
|
from typing import Union, Literal
|
||||||
|
|
||||||
|
PrimitiveType = Literal["entity", "string", "float", "integer", "boolean", "enum", "binary"]
|
||||||
|
ComplexPrimitiveType = Literal["list", "array", "set"]
|
||||||
|
PrimitiveTypeOutput = Union[
|
||||||
|
PrimitiveType,
|
||||||
|
tuple[ComplexPrimitiveType, "PrimitiveTypeOutput"],
|
||||||
|
tuple[Literal["select"], tuple["PrimitiveTypeOutput", ...]],
|
||||||
|
None,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_primitive_type(
|
def get_primitive_type(
|
||||||
attribute_or_data_type: Union[ifcopenshell_wrapper.attribute, ifcopenshell_wrapper.parameter_type],
|
attribute_or_data_type: Union[ifcopenshell_wrapper.attribute, ifcopenshell_wrapper.parameter_type],
|
||||||
) -> Union[str, tuple[str, list[str]]]:
|
) -> PrimitiveTypeOutput:
|
||||||
if hasattr(attribute_or_data_type, "type_of_attribute"):
|
if isinstance(attribute_or_data_type, ifcopenshell_wrapper.attribute):
|
||||||
data_type = str(attribute_or_data_type.type_of_attribute())
|
data_type = str(attribute_or_data_type.type_of_attribute())
|
||||||
else:
|
else:
|
||||||
data_type = str(attribute_or_data_type)
|
data_type = str(attribute_or_data_type)
|
||||||
@@ -56,8 +65,16 @@ def get_primitive_type(
|
|||||||
|
|
||||||
|
|
||||||
def get_enum_items(attribute: ifcopenshell_wrapper.attribute) -> tuple[str, ...]:
|
def get_enum_items(attribute: ifcopenshell_wrapper.attribute) -> tuple[str, ...]:
|
||||||
return attribute.type_of_attribute().declared_type().enumeration_items()
|
named_type = attribute.type_of_attribute().as_named_type()
|
||||||
|
assert named_type
|
||||||
|
enumeration = named_type.declared_type().as_enumeration_type()
|
||||||
|
assert enumeration
|
||||||
|
return enumeration.enumeration_items()
|
||||||
|
|
||||||
|
|
||||||
def get_select_items(attribute: ifcopenshell_wrapper.attribute) -> tuple[ifcopenshell_wrapper.entity, ...]:
|
def get_select_items(attribute: ifcopenshell_wrapper.attribute) -> tuple[ifcopenshell_wrapper.declaration, ...]:
|
||||||
return attribute.type_of_attribute().declared_type().select_list()
|
named_type = attribute.type_of_attribute().as_named_type()
|
||||||
|
assert named_type
|
||||||
|
select_type = named_type.declared_type().as_select_type()
|
||||||
|
assert select_type
|
||||||
|
return select_type.select_list()
|
||||||
|
|||||||
Reference in New Issue
Block a user