(self, context)
| 131 | item: bpy.props.IntProperty() |
| 132 | |
| 133 | def _execute(self, context): |
| 134 | obj = context.active_object |
| 135 | element = tool.Ifc.get_entity(obj) |
| 136 | props = tool.Model.get_array_props(obj) |
| 137 | si_conversion = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) |
| 138 | |
| 139 | pset = ifcopenshell.util.element.get_pset(element, "BBIM_Array") |
| 140 | data = json.loads(pset["Data"]) |
| 141 | data[self.item] = { |
| 142 | "children": data[self.item]["children"], |
| 143 | "count": props.count, |
| 144 | "x": props.x / si_conversion, |
| 145 | "y": props.y / si_conversion, |
| 146 | "z": props.z / si_conversion, |
| 147 | "use_local_space": props.use_local_space, |
| 148 | "method": props.method, |
| 149 | } |
| 150 | |
| 151 | props.is_editing = -1 |
| 152 | |
| 153 | try: |
| 154 | parent_element = tool.Ifc.get().by_guid(pset["Parent"]) |
| 155 | parent = tool.Ifc.get_object(parent_element) |
| 156 | except: |
| 157 | return {"FINISHED"} |
| 158 | |
| 159 | tool.Blender.Modifier.Array.remove_constraints(parent_element) |
| 160 | tool.Model.regenerate_array(parent, data) |
| 161 | tool.Blender.Modifier.Array.set_children_lock_state(element, self.item, True) |
| 162 | tool.Blender.Modifier.Array.constrain_children_to_parent(element) |
| 163 | |
| 164 | # clears the relating_array_object so it doesn't show again next time |
| 165 | props.relating_array_object = None |
| 166 | |
| 167 | |
| 168 | class ApplyArray(bpy.types.Operator, tool.Ifc.Operator): |
nothing calls this directly
no test coverage detected