mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-13 06:53:36 +00:00
Update Profiles UI profile editing arbitrary profile #6284
This commit is contained in:
@@ -2260,6 +2260,7 @@ class OverrideModeSetObject(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
profile.ProfileName = old_profile.ProfileName
|
profile.ProfileName = old_profile.ProfileName
|
||||||
for inverse in tool.Ifc.get().get_inverse(old_profile):
|
for inverse in tool.Ifc.get().get_inverse(old_profile):
|
||||||
ifcopenshell.util.element.replace_attribute(inverse, old_profile, profile)
|
ifcopenshell.util.element.replace_attribute(inverse, old_profile, profile)
|
||||||
|
tool.Profile.replace_profile_in_profiles_ui(old_profile.id(), profile.id())
|
||||||
ifcopenshell.util.element.remove_deep2(tool.Ifc.get(), old_profile)
|
ifcopenshell.util.element.remove_deep2(tool.Ifc.get(), old_profile)
|
||||||
|
|
||||||
tool.Geometry.reload_representation(props.representation_obj)
|
tool.Geometry.reload_representation(props.representation_obj)
|
||||||
|
|||||||
@@ -125,6 +125,14 @@ class Profile(bonsai.core.tool.Profile):
|
|||||||
props = cls.get_profile_props()
|
props = cls.get_profile_props()
|
||||||
return tool.Blender.get_active_uilist_element(props.profiles, props.active_profile_index)
|
return tool.Blender.get_active_uilist_element(props.profiles, props.active_profile_index)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def replace_profile_in_profiles_ui(cls, old_profile_id: int, new_profile_id: int) -> None:
|
||||||
|
props = cls.get_profile_props()
|
||||||
|
for profile in props.profiles:
|
||||||
|
if profile.ifc_definition_id == old_profile_id:
|
||||||
|
profile.ifc_definition_id = new_profile_id
|
||||||
|
return
|
||||||
|
|
||||||
# Lengths are in meters.
|
# Lengths are in meters.
|
||||||
DEFAULT_PROFILE_ATTRS = {
|
DEFAULT_PROFILE_ATTRS = {
|
||||||
"IfcCircleProfileDef": {
|
"IfcCircleProfileDef": {
|
||||||
|
|||||||
Reference in New Issue
Block a user