mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Sync blender and IFC names. See #1222.
This commit is contained in:
@@ -94,12 +94,19 @@ class EditAttributes(bpy.types.Operator):
|
|||||||
attributes[attribute["name"]] = blender_attribute.float_value
|
attributes[attribute["name"]] = blender_attribute.float_value
|
||||||
elif attribute["type"] == "enum":
|
elif attribute["type"] == "enum":
|
||||||
attributes[attribute["name"]] = blender_attribute.enum_value
|
attributes[attribute["name"]] = blender_attribute.enum_value
|
||||||
|
product = self.file.by_id(oprops.ifc_definition_id)
|
||||||
edit_attributes.Usecase(self.file, {
|
edit_attributes.Usecase(self.file, {
|
||||||
"product": self.file.by_id(oprops.ifc_definition_id),
|
"product": product,
|
||||||
"attributes": attributes
|
"attributes": attributes
|
||||||
}).execute()
|
}).execute()
|
||||||
|
if "Name" in attributes:
|
||||||
|
new_name = "{}/{}".format(product.is_a(), product.Name or "Unnamed")
|
||||||
|
collection = bpy.data.collections.get(obj.name)
|
||||||
|
if collection:
|
||||||
|
collection.name = new_name
|
||||||
|
obj.name = new_name
|
||||||
Data.load(oprops.ifc_definition_id)
|
Data.load(oprops.ifc_definition_id)
|
||||||
bpy.ops.bim.disable_editing_attributes(obj=self.obj, obj_type=self.obj_type)
|
bpy.ops.bim.disable_editing_attributes(obj=obj.name, obj_type=self.obj_type)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user