mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Big bSDD overhaul for properties and classifications. See description.
* bSDD now supports a couple more args when querying the API. * Fetching properties via the classification UI has been removed * The bSDD dictionary selector has been merged into the classification source dropdown * The bSDD dictionary selector merged into the property set name dropdown * You can now search for properties in the bSDD directly when adding properties * You can browse properties via groups or classifications (based on assigned classifications) * You can browse properties via keyword (with some limitations due to the API) * You can selectively choose which properties you then want to add. Only basic support right now.
This commit is contained in:
@@ -21,6 +21,12 @@ from typing import Optional
|
||||
|
||||
|
||||
def get_references(element: ifcopenshell.entity_instance, should_inherit=True) -> set[ifcopenshell.entity_instance]:
|
||||
"""Gets classification references associated with the element
|
||||
|
||||
:param should_inherit: If true, classification references are inherited
|
||||
from the type. Classifications can be overriden per system.
|
||||
:return: A set of IfcClassificationReference
|
||||
"""
|
||||
results = set()
|
||||
if not element.is_a("IfcRoot"):
|
||||
if (references := getattr(element, "HasExternalReferences", None)) is not None or (
|
||||
@@ -52,6 +58,11 @@ def get_references(element: ifcopenshell.entity_instance, should_inherit=True) -
|
||||
|
||||
|
||||
def get_classification(reference: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance:
|
||||
"""Get the IfcClassification that a classification reference belongs to
|
||||
|
||||
:param reference: An IfcClassificationReference
|
||||
:return: IfcClassification
|
||||
"""
|
||||
if reference.is_a("IfcClassification"):
|
||||
return reference
|
||||
return get_classification(reference.ReferencedSource) if reference.ReferencedSource is not None else None
|
||||
|
||||
Reference in New Issue
Block a user