mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Minor fix to new collection organisation for drawings
This commit is contained in:
@@ -740,10 +740,14 @@ class Blender(blenderbim.core.tool.Blender):
|
|||||||
return {"PASS_THROUGH"}
|
return {"PASS_THROUGH"}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_layer_collection(
|
def get_layer_collection(cls, collection: bpy.types.Collection) -> Union[bpy.types.LayerCollection, None]:
|
||||||
cls, collection: bpy.types.Collection, view_layer: Optional[bpy.types.ViewLayer] = None
|
project = tool.Ifc.get_object(tool.Ifc.get().by_type("IfcProject")[0])
|
||||||
) -> Union[bpy.types.LayerCollection, None]:
|
project_collection = project.BIMObjectProperties.collection
|
||||||
return cls.get_layer_collections_mapping([collection], view_layer).get(collection)
|
for layer_collection in bpy.context.view_layer.layer_collection.children:
|
||||||
|
if layer_collection.collection == project_collection:
|
||||||
|
for layer_collection2 in layer_collection.children:
|
||||||
|
if layer_collection2.collection == collection:
|
||||||
|
return layer_collection2
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_layer_collections_mapping(
|
def get_layer_collections_mapping(
|
||||||
|
|||||||
@@ -468,7 +468,7 @@ def get_type(element: ifcopenshell.entity_instance) -> Union[ifcopenshell.entity
|
|||||||
|
|
||||||
schema = element.file.schema
|
schema = element.file.schema
|
||||||
if schema != "IFC2X3":
|
if schema != "IFC2X3":
|
||||||
if is_typed_by := element.IsTypedBy:
|
if is_typed_by := getattr(element, "IsTypedBy", []):
|
||||||
return is_typed_by[0].RelatingType
|
return is_typed_by[0].RelatingType
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user