diff --git a/src/blenderbim/blenderbim/bim/module/pset/data.py b/src/blenderbim/blenderbim/bim/module/pset/data.py index 73b470c46b..74cb0b353e 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/data.py +++ b/src/blenderbim/blenderbim/bim/module/pset/data.py @@ -19,7 +19,6 @@ import bpy import ifcopenshell import blenderbim.tool as tool -from blenderbim.bim.prop import get_ifc_entity_description # TODO: Should this cache belong here? Dunno. Maybe. @@ -174,4 +173,8 @@ class AddEditCustomPropertiesData: @classmethod def primary_measure_type(cls): schema = tool.Ifc.schema() - return [(t, t, get_ifc_entity_description(t)) for t in sorted([d.name() for d in schema.declarations() if hasattr(d, "declared_type")])] + version = tool.Ifc.get_schema() + return [ + (t, t, ifcopenshell.util.doc.get_type_doc(version, t).get("description")) + for t in sorted([d.name() for d in schema.declarations() if hasattr(d, "declared_type")]) + ] diff --git a/src/blenderbim/blenderbim/bim/module/pset/prop.py b/src/blenderbim/blenderbim/bim/module/pset/prop.py index 6e957f857a..6e56616fa8 100644 --- a/src/blenderbim/blenderbim/bim/module/pset/prop.py +++ b/src/blenderbim/blenderbim/bim/module/pset/prop.py @@ -21,6 +21,7 @@ import blenderbim.bim.schema from blenderbim.bim.prop import Attribute, StrProperty import ifcopenshell from ifcopenshell.api.pset.data import Data +import blenderbim.tool as tool from blenderbim.bim.module.pset.data import AddEditCustomPropertiesData from blenderbim.bim.ifc import IfcStore from blenderbim.bim.prop import get_property_set_description @@ -138,6 +139,12 @@ def get_qto_names(self, context): return [] +def get_template_type(self, context): + version = tool.Ifc.get_schema() + for t in ("IfcPropertySingleValue", "IfcPropertyEnumeratedValue"): + yield (t, t, ifcopenshell.util.doc.get_entity_doc(version, t).get("description")) + + def get_primary_measure_type(self, context): if not AddEditCustomPropertiesData.is_loaded: AddEditCustomPropertiesData.load() @@ -214,13 +221,7 @@ class AddEditProperties(PropertyGroup): int_value: IntProperty(name="Value") float_value: FloatProperty(name="Value") primary_measure_type: EnumProperty(items=get_primary_measure_type, name="Primary Measure Type") - template_type: EnumProperty( - items=[ - ("IfcPropertySingleValue", "IfcPropertySingleValue", "IfcPropertySingleValue"), - ("IfcPropertyEnumeratedValue", "IfcPropertyEnumeratedValue", "IfcPropertyEnumeratedValue"), - ], - name="Template Type", - ) + template_type: EnumProperty(items=get_template_type, name="Template Type") enum_values: CollectionProperty(name="Enum Values", type=Attribute) def get_value_name(self): diff --git a/src/blenderbim/blenderbim/bim/module/pset_template/data.py b/src/blenderbim/blenderbim/bim/module/pset_template/data.py index 2b3697d375..5481e50211 100644 --- a/src/blenderbim/blenderbim/bim/module/pset_template/data.py +++ b/src/blenderbim/blenderbim/bim/module/pset_template/data.py @@ -44,7 +44,11 @@ class PsetTemplatesData: @classmethod def primary_measure_type(cls): schema = tool.Ifc.schema() - return [(t, t, get_ifc_entity_description(t)) for t in sorted([d.name() for d in schema.declarations() if hasattr(d, "declared_type")])] + version = tool.Ifc.get_schema() + return [ + (t, t, ifcopenshell.util.doc.get_type_doc(version, t).get("description")) + for t in sorted([d.name() for d in schema.declarations() if hasattr(d, "declared_type")]) + ] @classmethod def pset_template_files(cls):