mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Directly use pset doc functions instead of wrapped ones
This commit is contained in:
@@ -24,7 +24,6 @@ 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
|
||||
from bpy.types import PropertyGroup
|
||||
from bpy.props import (
|
||||
PointerProperty,
|
||||
@@ -50,7 +49,12 @@ def purge():
|
||||
|
||||
|
||||
def blender_formatted_enum_from_psets(psets):
|
||||
return [(p.Name, p.Name, get_property_set_description(p.Name)) for p in psets]
|
||||
enum_items = []
|
||||
version = tool.Ifc.get_schema()
|
||||
for pset in psets:
|
||||
doc = ifcopenshell.util.doc.get_property_set_doc(version, pset.Name) or {}
|
||||
enum_items.append((pset.Name, pset.Name, doc.get("description", "")))
|
||||
return enum_items
|
||||
|
||||
|
||||
def get_pset_names(self, context):
|
||||
|
||||
@@ -141,27 +141,6 @@ def get_attribute_description(entity, attribute):
|
||||
return doc
|
||||
|
||||
|
||||
def get_property_set_docs(pset):
|
||||
schema = tool.Ifc.get_schema()
|
||||
if schema is not None:
|
||||
return get_property_set_doc(schema, pset)
|
||||
|
||||
|
||||
def get_property_set_description(pset):
|
||||
docs = get_property_set_docs(pset)
|
||||
return docs.get("description", "") if docs is not None else ""
|
||||
|
||||
|
||||
def get_property_set_properties(pset):
|
||||
docs = get_property_set_docs(pset)
|
||||
return docs.get("properties", {}) if docs is not None else {}
|
||||
|
||||
|
||||
def get_property_set_doc_url(pset):
|
||||
docs = get_property_set_docs(pset)
|
||||
return docs.get("spec_url", "") if docs is not None else ""
|
||||
|
||||
|
||||
def get_attribute_enum_values(prop, context):
|
||||
# Support weird buildingSMART dictionary mappings which behave like enums
|
||||
items = []
|
||||
|
||||
Reference in New Issue
Block a user