mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Adding a new type instance (like furniture, walls) now snaps it to the bottom of the storey you're working on. Nice.
This commit is contained in:
@@ -109,7 +109,7 @@ class BIM_PT_object_material(Panel):
|
||||
if self.props.is_editing:
|
||||
op = row.operator("bim.edit_assigned_material", icon="CHECKMARK", text="")
|
||||
op.material_set = self.material_set_id
|
||||
row.operator("bim.disable_editing_assigned_material", icon="X", text="")
|
||||
row.operator("bim.disable_editing_assigned_material", icon="CANCEL", text="")
|
||||
else:
|
||||
row.operator("bim.enable_editing_assigned_material", icon="GREASEPENCIL", text="")
|
||||
row.operator("bim.unassign_material", icon="X", text="")
|
||||
@@ -168,7 +168,7 @@ class BIM_PT_object_material(Panel):
|
||||
row.prop(self.props, "material_set_item_material", icon="MATERIAL")
|
||||
op = row.operator("bim.edit_material_set_item", icon="CHECKMARK", text="")
|
||||
op.material_set_item = set_item_id
|
||||
row.operator("bim.disable_editing_material_set_item", icon="X", text="")
|
||||
row.operator("bim.disable_editing_material_set_item", icon="CANCEL", text="")
|
||||
|
||||
for attribute in self.props.material_set_item_attributes:
|
||||
row = box.row(align=True)
|
||||
@@ -197,7 +197,7 @@ class BIM_PT_object_material(Panel):
|
||||
else:
|
||||
# TODO: support non parametric profiles by showing a list of named profiles to select from, or an
|
||||
# eyedropper to pick profile geometry from the scene
|
||||
row.operator("bim.disable_editing_material_set_item", icon="X", text="")
|
||||
row.operator("bim.disable_editing_material_set_item", icon="CANCEL", text="")
|
||||
|
||||
def draw_editable_profile_ui(self, layout, item):
|
||||
for attribute in self.props.material_set_item_profile_attributes:
|
||||
|
||||
@@ -37,9 +37,11 @@ class AddTypeInstance(bpy.types.Operator):
|
||||
mesh.from_pydata(verts, edges, faces)
|
||||
obj = bpy.data.objects.new("Instance", mesh)
|
||||
obj.location = context.scene.cursor.location
|
||||
context.view_layer.active_layer_collection.collection.objects.link(obj)
|
||||
self.file = IfcStore.get_file()
|
||||
instance_class = ifcopenshell.util.type.get_applicable_entities(tprops.ifc_class, self.file.schema)[0]
|
||||
collection = bpy.context.view_layer.active_layer_collection.collection
|
||||
collection.objects.link(obj)
|
||||
collection_obj = bpy.data.objects.get(collection.name)
|
||||
if collection_obj:
|
||||
obj.location[2] = collection_obj.location[2] - min(v[2] for v in obj.bound_box)
|
||||
bpy.ops.bim.assign_class(obj=obj.name, ifc_class=instance_class)
|
||||
bpy.ops.bim.assign_type(relating_type=int(tprops.relating_type), related_object=obj.name)
|
||||
return {"FINISHED"}
|
||||
|
||||
Reference in New Issue
Block a user