This commit is contained in:
Andrej730
2025-06-30 17:41:21 +05:00
parent 260bc80a4b
commit c23c21cb88
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ class Drawing(bonsai.core.tool.Drawing):
vec = Vector((1, 0, 0)) # Fallback to a unit vector
else:
vec = vec.normalized()
scaled_length = 0.023 * scale #0.023 could probably be a preference
scaled_length = 0.023 * scale # 0.023 could probably be a preference
co_end = co1 + vec * scaled_length
obj = annotation.Annotator.add_line_to_annotation(obj, co_end, co1)
obj.matrix_world = obj.matrix_world @ Matrix.Rotation(math.radians(-90), 4, "Z")
+6 -3
View File
@@ -125,7 +125,9 @@ class Spatial(bonsai.core.tool.Spatial):
return ifcopenshell.util.element.get_container(element)
@classmethod
def get_decomposed_elements(cls, container: ifcopenshell.entity_instance, is_recursive=True) -> list[ifcopenshell.entity_instance]:
def get_decomposed_elements(
cls, container: ifcopenshell.entity_instance, is_recursive=True
) -> list[ifcopenshell.entity_instance]:
return ifcopenshell.util.element.get_decomposition(container, is_recursive=is_recursive)
@classmethod
@@ -1304,9 +1306,10 @@ class Spatial(bonsai.core.tool.Spatial):
props = cls.get_object_spatial_props(obj)
props.container_obj = container_obj
@classmethod
def get_filtered_elements(cls, should_filter: bool = True, is_recursive: bool = True) -> Iterable[ifcopenshell.entity_instance]:
def get_filtered_elements(
cls, should_filter: bool = True, is_recursive: bool = True
) -> Iterable[ifcopenshell.entity_instance]:
ifc_file = tool.Ifc.get()
props = cls.get_spatial_props()
container = ifc_file.by_id(props.active_container.ifc_definition_id)