mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Set IfcMaterialLayerSetUsage's DirectionSense/OffsetFromReferenceLine/ReferenceExtent on all selected objects
This commit is contained in:
@@ -582,25 +582,35 @@ class EditAssignedMaterial(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
attributes=attributes,
|
attributes=attributes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if self.material_set_usage:
|
if self.material_set_usage:
|
||||||
material_set_usage = self.file.by_id(self.material_set_usage)
|
material_set_usage = self.file.by_id(self.material_set_usage)
|
||||||
attributes = bonsai.bim.helper.export_attributes(props.material_set_usage_attributes)
|
attributes = bonsai.bim.helper.export_attributes(props.material_set_usage_attributes)
|
||||||
|
|
||||||
if material_set_usage.is_a("IfcMaterialLayerSetUsage"):
|
if material_set_usage.is_a("IfcMaterialLayerSetUsage"):
|
||||||
ifcopenshell.api.material.edit_layer_usage(
|
ifcopenshell.api.material.edit_layer_usage(
|
||||||
self.file,
|
self.file,
|
||||||
usage=material_set_usage,
|
usage=material_set_usage,
|
||||||
attributes=attributes,
|
attributes=attributes,
|
||||||
)
|
)
|
||||||
slab.DumbSlabPlaner().regenerate_from_layer_set(material_set_usage.ForLayerSet)
|
|
||||||
wall.DumbWallPlaner().regenerate_from_layer_set(material_set_usage.ForLayerSet)
|
layer_sets_to_regenerate = set()
|
||||||
elif material_set_usage.is_a("IfcMaterialProfileSetUsage"):
|
|
||||||
if attributes.get("CardinalPoint", None):
|
for obj in objects:
|
||||||
attributes["CardinalPoint"] = int(attributes["CardinalPoint"])
|
obj_element = tool.Ifc.get_entity(obj)
|
||||||
ifcopenshell.api.material.edit_profile_usage(
|
obj_material_usage = ifcopenshell.util.element.get_material(obj_element)
|
||||||
self.file,
|
|
||||||
usage=material_set_usage,
|
if obj_material_usage and obj_material_usage.is_a("IfcMaterialLayerSetUsage"):
|
||||||
attributes=attributes,
|
obj_material_usage.OffsetFromReferenceLine = material.OffsetFromReferenceLine
|
||||||
)
|
obj_material_usage.DirectionSense = material.DirectionSense
|
||||||
|
obj_material_usage.ReferenceExtent = material.ReferenceExtent
|
||||||
|
|
||||||
|
layer_sets_to_regenerate.add(obj_material_usage.ForLayerSet)
|
||||||
|
|
||||||
|
|
||||||
|
for layer_set in layer_sets_to_regenerate:
|
||||||
|
wall.DumbWallPlaner().regenerate_from_layer_set(layer_set)
|
||||||
|
slab.DumbSlabPlaner().regenerate_from_layer_set(layer_set)
|
||||||
|
|
||||||
bpy.ops.bim.disable_editing_assigned_material(obj=active_obj.name)
|
bpy.ops.bim.disable_editing_assigned_material(obj=active_obj.name)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user