mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
BBIM: Feature to select an annotation's assigned object
This commit is contained in:
@@ -63,6 +63,7 @@ classes = (
|
||||
operator.ResizeText,
|
||||
operator.SaveDrawingStyle,
|
||||
operator.SelectDocIfcFile,
|
||||
operator.SelectAssignedProduct,
|
||||
prop.Variable,
|
||||
prop.Drawing,
|
||||
prop.Schedule,
|
||||
|
||||
@@ -1363,3 +1363,11 @@ class ContractSheet(bpy.types.Operator):
|
||||
sheet.is_expanded = False
|
||||
core.load_sheets(tool.Drawing)
|
||||
return {"FINISHED"}
|
||||
|
||||
class SelectAssignedProduct(bpy.types.Operator, Operator):
|
||||
bl_idname = "bim.select_assigned_product"
|
||||
bl_label = "Select Assigned Product"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def _execute(self, context):
|
||||
core.select_assigned_product(tool.Drawing)
|
||||
@@ -314,6 +314,7 @@ class BIM_PT_product_assignments(Panel):
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text=ProductAssignmentsData.data["relating_product"] or "No Relating Product", icon="OBJECT_DATA")
|
||||
row.operator("bim.enable_editing_assigned_product", icon="GREASEPENCIL", text="")
|
||||
row.operator("bim.select_assigned_product", icon="RESTRICT_SELECT_OFF", text="")
|
||||
|
||||
|
||||
class BIM_PT_text(Panel):
|
||||
|
||||
@@ -259,3 +259,6 @@ def sync_references(ifc, collector, drawing_tool, drawing=None):
|
||||
|
||||
if reference_obj and ifc.is_edited(reference_obj):
|
||||
drawing_tool.sync_object_representation(reference_obj)
|
||||
|
||||
def select_assigned_product(drawing):
|
||||
drawing.select_assigned_product()
|
||||
@@ -198,6 +198,7 @@ class Drawing:
|
||||
def open_spreadsheet(cls, uri): pass
|
||||
def open_svg(cls, filepath): pass
|
||||
def run_root_assign_class(cls, obj=None, ifc_class=None, predefined_type=None, should_add_representation=True, context=None, ifc_representation_class=None): pass
|
||||
def select_assigned_product(cls, drawing): pass
|
||||
def set_drawing_collection_name(cls, group, collection): pass
|
||||
def show_decorations(cls): pass
|
||||
def sync_object_placement(cls, obj): pass
|
||||
|
||||
@@ -898,3 +898,10 @@ class Drawing(blenderbim.core.tool.Drawing):
|
||||
if tool.Ifc.get_schema() == "IFC2X3":
|
||||
return reference.ReferenceToDocument[0]
|
||||
return reference.ReferencedDocument
|
||||
@classmethod
|
||||
def select_assigned_product(cls):
|
||||
obj = cls.get_active_object()
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
product = cls.get_assigned_product(element)
|
||||
if product:
|
||||
tool.Ifc.get_object(product).select_set(True)
|
||||
Reference in New Issue
Block a user