MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_actions

Method get_actions

src/ifc2ca/ifc2ca.py:95–121  ·  view source on GitHub ↗
(
        self,
        load_group: ios.entity_instance | None = None,
        element: ios.entity_instance | None = None,
        load_group_ids: list[int] | None = None,
    )

Source from the content-addressed store, hash-verified

93
94 ## functions related to loads and load groups
95 def get_actions(
96 self,
97 load_group: ios.entity_instance | None = None,
98 element: ios.entity_instance | None = None,
99 load_group_ids: list[int] | None = None,
100 ):
101 if load_group is not None:
102 actions = [
103 item
104 for item in ifcopenshell.util.element.get_grouped_by(load_group)
105 if item.is_a("IfcStructuralAction")
106 ]
107 return actions
108
109 if element is not None:
110 actions = [
111 item.RelatedStructuralActivity
112 for item in element.AssignedStructuralActivity
113 if item.RelatedStructuralActivity.is_a("IfcStructuralAction")
114 ]
115 if load_group_ids is None:
116 return actions
117
118 actions = [action for action in actions if self.get_load_group(action).id() in load_group_ids]
119 return actions
120
121 return [item for item in self.file.by_type("IfcStructuralAction")]
122
123 def get_load_group(self, action: ios.entity_instance):
124 if action.HasAssignments is None:

Callers 1

parse_element_loadsMethod · 0.95

Calls 4

get_load_groupMethod · 0.95
is_aMethod · 0.45
idMethod · 0.45
by_typeMethod · 0.45

Tested by

no test coverage detected