mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 12:07:59 +00:00
Property set templates attributes now show a tooltip on hover
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
import os
|
import os
|
||||||
import bpy
|
import bpy
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
|
from ifcopenshell.util.doc import get_attribute_doc
|
||||||
from blenderbim.bim.module.pset_template.data import PsetTemplatesData
|
from blenderbim.bim.module.pset_template.data import PsetTemplatesData
|
||||||
from blenderbim.bim.prop import StrProperty, Attribute
|
from blenderbim.bim.prop import StrProperty, Attribute
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
@@ -111,11 +112,27 @@ def get_template_type(self, context):
|
|||||||
|
|
||||||
|
|
||||||
class PsetTemplate(PropertyGroup):
|
class PsetTemplate(PropertyGroup):
|
||||||
global_id: StringProperty(name="Global ID")
|
global_id: StringProperty(
|
||||||
name: StringProperty(name="Name")
|
name="Global ID",
|
||||||
description: StringProperty(name="Description")
|
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "GlobalId"),
|
||||||
template_type: EnumProperty(items=get_template_type, name="Template Type")
|
)
|
||||||
applicable_entity: StringProperty(name="Applicable Entity")
|
name: StringProperty(
|
||||||
|
name="Name",
|
||||||
|
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "Name"),
|
||||||
|
)
|
||||||
|
description: StringProperty(
|
||||||
|
name="Description",
|
||||||
|
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "Description"),
|
||||||
|
)
|
||||||
|
template_type: EnumProperty(
|
||||||
|
items=get_template_type,
|
||||||
|
name="Template Type",
|
||||||
|
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "TemplateType"),
|
||||||
|
)
|
||||||
|
applicable_entity: StringProperty(
|
||||||
|
name="Applicable Entity",
|
||||||
|
description=get_attribute_doc("IFC4", "IfcPropertySetTemplate", "ApplicableEntity"),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumerationValues(PropertyGroup):
|
class EnumerationValues(PropertyGroup):
|
||||||
@@ -126,9 +143,18 @@ class EnumerationValues(PropertyGroup):
|
|||||||
|
|
||||||
|
|
||||||
class PropTemplate(PropertyGroup):
|
class PropTemplate(PropertyGroup):
|
||||||
global_id: StringProperty(name="Global ID")
|
global_id: StringProperty(
|
||||||
name: StringProperty(name="Name")
|
name="Global ID",
|
||||||
description: StringProperty(name="Description")
|
description=get_attribute_doc("IFC4", "IfcPropertyTemplate", "GlobalId"),
|
||||||
|
)
|
||||||
|
name: StringProperty(
|
||||||
|
name="Name",
|
||||||
|
description=get_attribute_doc("IFC4", "IfcPropertyTemplate", "Name"),
|
||||||
|
)
|
||||||
|
description: StringProperty(
|
||||||
|
name="Description",
|
||||||
|
description=get_attribute_doc("IFC4", "IfcPropertyTemplate", "Description"),
|
||||||
|
)
|
||||||
primary_measure_type: EnumProperty(items=get_primary_measure_type, name="Primary Measure Type")
|
primary_measure_type: EnumProperty(items=get_primary_measure_type, name="Primary Measure Type")
|
||||||
template_type: EnumProperty(
|
template_type: EnumProperty(
|
||||||
items=[("P_SINGLEVALUE", "P_SINGLEVALUE", ""), ("P_ENUMERATEDVALUE", "P_ENUMERATEDVALUE", "")],
|
items=[("P_SINGLEVALUE", "P_SINGLEVALUE", ""), ("P_ENUMERATEDVALUE", "P_ENUMERATEDVALUE", "")],
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ from ifcopenshell.util.doc import (
|
|||||||
get_entity_doc,
|
get_entity_doc,
|
||||||
get_property_set_doc,
|
get_property_set_doc,
|
||||||
get_type_doc,
|
get_type_doc,
|
||||||
|
get_attribute_doc,
|
||||||
)
|
)
|
||||||
from . import ifc
|
from . import ifc
|
||||||
import blenderbim.tool as tool
|
import blenderbim.tool as tool
|
||||||
@@ -406,7 +407,6 @@ def draw_custom_context_menu(self, context):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
if isinstance(context.button_pointer, Attribute):
|
if isinstance(context.button_pointer, Attribute):
|
||||||
print(prop, prop_name, prop_value)
|
|
||||||
description = getattr(context.button_pointer, "description", None)
|
description = getattr(context.button_pointer, "description", None)
|
||||||
ifc_class = getattr(context.button_pointer, "ifc_class", "")
|
ifc_class = getattr(context.button_pointer, "ifc_class", "")
|
||||||
if ifc_class:
|
if ifc_class:
|
||||||
|
|||||||
Reference in New Issue
Block a user