mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Directly use attribute doc functions instead of wrapper
This commit is contained in:
@@ -23,10 +23,12 @@ import math
|
|||||||
import zipfile
|
import zipfile
|
||||||
import ifcopenshell
|
import ifcopenshell
|
||||||
import ifcopenshell.util.attribute
|
import ifcopenshell.util.attribute
|
||||||
|
from ifcopenshell.util.doc import get_attribute_doc
|
||||||
from mathutils import geometry
|
from mathutils import geometry
|
||||||
from mathutils import Vector
|
from mathutils import Vector
|
||||||
|
import blenderbim.tool as tool
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
from blenderbim.bim.prop import get_attribute_description, get_predefined_type_description
|
from blenderbim.bim.prop import get_predefined_type_description
|
||||||
|
|
||||||
|
|
||||||
def draw_attributes(props, layout, copy_operator=None):
|
def draw_attributes(props, layout, copy_operator=None):
|
||||||
@@ -123,7 +125,8 @@ def add_attribute_enum_items_descriptions(attribute_blender, enum_items):
|
|||||||
def add_attribute_description(attribute_blender):
|
def add_attribute_description(attribute_blender):
|
||||||
if not attribute_blender.name:
|
if not attribute_blender.name:
|
||||||
return
|
return
|
||||||
description = get_attribute_description(attribute_blender.ifc_class, attribute_blender.name)
|
version = tool.Ifc.get_schema()
|
||||||
|
description = get_attribute_doc(version, attribute_blender.ifc_class, attribute_blender.name)
|
||||||
if description:
|
if description:
|
||||||
attribute_blender.description = description
|
attribute_blender.description = description
|
||||||
|
|
||||||
|
|||||||
@@ -115,16 +115,6 @@ def get_predefined_type_description(entity, predefined_type):
|
|||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def get_attribute_description(entity, attribute):
|
|
||||||
schema = tool.Ifc.get_schema()
|
|
||||||
if schema is not None:
|
|
||||||
try:
|
|
||||||
doc = get_attribute_doc(schema, entity, attribute)
|
|
||||||
except KeyError: # This entity doesn't have any attribute or doesn't implement this attribute
|
|
||||||
pass
|
|
||||||
return doc
|
|
||||||
|
|
||||||
|
|
||||||
def get_attribute_enum_values(prop, context):
|
def get_attribute_enum_values(prop, context):
|
||||||
# Support weird buildingSMART dictionary mappings which behave like enums
|
# Support weird buildingSMART dictionary mappings which behave like enums
|
||||||
items = []
|
items = []
|
||||||
|
|||||||
Reference in New Issue
Block a user