mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 13:28:19 +00:00
New UI to assign constraints to objects and export
This commit is contained in:
@@ -242,6 +242,10 @@ class BIM_PT_constraints(Panel):
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'user_defined_qualifier')
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator('bim.assign_constraint', text='Assign Constraint')
|
||||
row.operator('bim.unassign_constraint', text='Unassign Constraint')
|
||||
|
||||
|
||||
class BIM_PT_documents(Panel):
|
||||
bl_label = 'IFC Documents'
|
||||
@@ -284,6 +288,50 @@ class BIM_PT_documents(Panel):
|
||||
layout.label(text="Reference is invalid")
|
||||
|
||||
|
||||
class BIM_PT_constraint_relations(Panel):
|
||||
bl_label = 'IFC Constraints'
|
||||
bl_idname = 'BIM_PT_constraint_relations'
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
bl_space_type = 'PROPERTIES'
|
||||
bl_region_type = 'WINDOW'
|
||||
bl_context = 'object'
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
props = context.active_object.BIMObjectProperties
|
||||
|
||||
if not props.constraints:
|
||||
layout.label(text="No constraints found")
|
||||
|
||||
if props.constraints:
|
||||
layout.template_list('BIM_UL_constraints', '', props, 'constraints', props, 'active_constraint_index')
|
||||
|
||||
if props.active_constraint_index < len(props.constraints):
|
||||
constraint = props.constraints[props.active_constraint_index]
|
||||
row = layout.row(align=True)
|
||||
row.prop(constraint, 'name')
|
||||
if constraint.name in bpy.context.scene.BIMProperties.constraints:
|
||||
constraint = bpy.context.scene.BIMProperties.constraints[constraint.name]
|
||||
row.operator('bim.remove_object_constraint', icon='X', text='').index = props.active_constraint_index
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'description')
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'constraint_grade')
|
||||
if constraint.constraint_grade == 'USERDEFINED':
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'user_defined_grade')
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'constraint_source')
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'objective_qualifier')
|
||||
if constraint.objective_qualifier == 'USERDEFINED':
|
||||
row = layout.row()
|
||||
row.prop(constraint, 'user_defined_qualifier')
|
||||
else:
|
||||
layout.label(text="Constraint is invalid")
|
||||
|
||||
|
||||
class BIM_PT_representations(Panel):
|
||||
bl_label = 'IFC Representations'
|
||||
bl_idname = 'BIM_PT_representations'
|
||||
|
||||
Reference in New Issue
Block a user