mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
Fix #2935. Duplicating objects clear any parametric array relationships.
This commit is contained in:
@@ -555,6 +555,10 @@ class OverrideDuplicateMove(bpy.types.Operator):
|
|||||||
# Copy the actual class
|
# Copy the actual class
|
||||||
new = blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
|
new = blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
|
||||||
if new:
|
if new:
|
||||||
|
array_pset = ifcopenshell.util.element.get_pset(new, "BBIM_Array")
|
||||||
|
if array_pset:
|
||||||
|
array_pset = tool.Ifc.get().by_id(array_pset["id"])
|
||||||
|
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), product=new, pset=array_pset)
|
||||||
old_to_new[tool.Ifc.get_entity(obj)] = [new]
|
old_to_new[tool.Ifc.get_entity(obj)] = [new]
|
||||||
# Recreate decompositions
|
# Recreate decompositions
|
||||||
tool.Root.recreate_decompositions(relationships, old_to_new)
|
tool.Root.recreate_decompositions(relationships, old_to_new)
|
||||||
@@ -615,6 +619,10 @@ class OverrideDuplicateMoveLinked(bpy.types.Operator):
|
|||||||
# Copy the actual class
|
# Copy the actual class
|
||||||
new = blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
|
new = blenderbim.core.root.copy_class(tool.Ifc, tool.Collector, tool.Geometry, tool.Root, obj=new_obj)
|
||||||
if new:
|
if new:
|
||||||
|
array_pset = ifcopenshell.util.element.get_pset(new, "BBIM_Array")
|
||||||
|
if array_pset:
|
||||||
|
array_pset = tool.Ifc.get().by_id(array_pset["id"])
|
||||||
|
ifcopenshell.api.run("pset.remove_pset", tool.Ifc.get(), product=new, pset=array_pset)
|
||||||
old_to_new[tool.Ifc.get_entity(obj)] = new
|
old_to_new[tool.Ifc.get_entity(obj)] = new
|
||||||
# Recreate decompositions
|
# Recreate decompositions
|
||||||
tool.Root.recreate_decompositions(relationships, old_to_new)
|
tool.Root.recreate_decompositions(relationships, old_to_new)
|
||||||
|
|||||||
@@ -86,10 +86,8 @@ class UnassignType(bpy.types.Operator):
|
|||||||
for representation in element.Representation.Representations:
|
for representation in element.Representation.Representations:
|
||||||
resolved_representation = ifcopenshell.util.representation.resolve_representation(representation)
|
resolved_representation = ifcopenshell.util.representation.resolve_representation(representation)
|
||||||
if representation == resolved_representation:
|
if representation == resolved_representation:
|
||||||
print('appending', representation)
|
|
||||||
representations.append(representation)
|
representations.append(representation)
|
||||||
else:
|
else:
|
||||||
print('copying', representation)
|
|
||||||
# We must unmap representations.
|
# We must unmap representations.
|
||||||
copied_representation = ifcopenshell.util.element.copy_deep(
|
copied_representation = ifcopenshell.util.element.copy_deep(
|
||||||
tool.Ifc.get(), resolved_representation, exclude=["IfcGeometricRepresentationContext"], exclude_callback=exclude_callback
|
tool.Ifc.get(), resolved_representation, exclude=["IfcGeometricRepresentationContext"], exclude_callback=exclude_callback
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import blenderbim.tool as tool
|
|||||||
import blenderbim.bim.module.type.prop as type_prop
|
import blenderbim.bim.module.type.prop as type_prop
|
||||||
from bpy.types import Panel
|
from bpy.types import Panel
|
||||||
from blenderbim.bim.ifc import IfcStore
|
from blenderbim.bim.ifc import IfcStore
|
||||||
|
from blenderbim.bim.helper import prop_with_search
|
||||||
from blenderbim.bim.module.type.data import TypeData
|
from blenderbim.bim.module.type.data import TypeData
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ class BIM_PT_type(Panel):
|
|||||||
|
|
||||||
row.prop(props, "relating_type_class", text="")
|
row.prop(props, "relating_type_class", text="")
|
||||||
if type_prop.get_relating_type(None, context):
|
if type_prop.get_relating_type(None, context):
|
||||||
row.prop(props, "relating_type", text="")
|
prop_with_search(row, props, "relating_type", text="")
|
||||||
row.operator("bim.assign_type", icon="CHECKMARK", text="")
|
row.operator("bim.assign_type", icon="CHECKMARK", text="")
|
||||||
else:
|
else:
|
||||||
row.label(text="No Types Found")
|
row.label(text="No Types Found")
|
||||||
|
|||||||
Reference in New Issue
Block a user