mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Rename 'add_brick_failed" to "add_brick_relation_failed"
This commit is contained in:
@@ -104,7 +104,7 @@ class BIMBrickProperties(PropertyGroup):
|
||||
brick_edit_relations_toggled: BoolProperty(name="Brick Edit Relations Toggled", default=False)
|
||||
new_brick_relation_type: EnumProperty(name="New Brick Relation Type", items=get_brick_relations)
|
||||
new_brick_relation_object: StringProperty(name="New Brick Relation Object")
|
||||
add_relation_failed: BoolProperty(name="Add Relation Failed", default=False)
|
||||
add_brick_relation_failed: BoolProperty(name="Add Relation Failed", default=False)
|
||||
# create relations split screen
|
||||
split_screen_toggled: BoolProperty(name="Split Screen Toggled", default=False)
|
||||
split_screen_bricks: CollectionProperty(name="Split Screen Bricks", type=Brick)
|
||||
|
||||
@@ -219,7 +219,7 @@ class BIM_PT_brickschema_viewport(Panel):
|
||||
row.prop(data=self.props, property="new_brick_relation_object", text="")
|
||||
row.operator("bim.add_brick_relation", text="", icon="ADD")
|
||||
|
||||
if self.props.brick_create_relations_toggled and self.props.add_relation_failed:
|
||||
if self.props.brick_create_relations_toggled and self.props.add_brick_relation_failed:
|
||||
row = self.layout.row(align=True)
|
||||
row.label(text="Failed to find this entity!", icon="ERROR")
|
||||
|
||||
|
||||
@@ -106,15 +106,15 @@ class Brick(blenderbim.core.tool.Brick):
|
||||
with BrickStore.new_changeset() as cs:
|
||||
cs.add((URIRef(brick_uri), URIRef(predicate), Literal(object)))
|
||||
bpy.context.scene.BIMBrickProperties.new_brick_relation_type = BrickStore.relationships[0][0]
|
||||
bpy.context.scene.BIMBrickProperties.add_relation_failed = False
|
||||
bpy.context.scene.BIMBrickProperties.add_brick_relation_failed = False
|
||||
return
|
||||
query = BrickStore.graph.query("ASK { <{object_uri}> a ?o . }".replace("{object_uri}", object))
|
||||
if query:
|
||||
with BrickStore.new_changeset() as cs:
|
||||
cs.add((URIRef(brick_uri), URIRef(predicate), URIRef(object)))
|
||||
bpy.context.scene.BIMBrickProperties.add_relation_failed = False
|
||||
bpy.context.scene.BIMBrickProperties.add_brick_relation_failed = False
|
||||
else:
|
||||
bpy.context.scene.BIMBrickProperties.add_relation_failed = True
|
||||
bpy.context.scene.BIMBrickProperties.add_brick_relation_failed = True
|
||||
|
||||
@classmethod
|
||||
def remove_relation(cls, brick_uri, predicate, object):
|
||||
|
||||
Reference in New Issue
Block a user