mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Fix #1871.
This commit is contained in:
@@ -278,6 +278,7 @@ class IfcStore:
|
|||||||
operator, rollback=lambda d: IfcStore.get_file().undo(), commit=lambda d: IfcStore.get_file().redo()
|
operator, rollback=lambda d: IfcStore.get_file().undo(), commit=lambda d: IfcStore.get_file().redo()
|
||||||
)
|
)
|
||||||
IfcStore.end_transaction(operator)
|
IfcStore.end_transaction(operator)
|
||||||
|
blenderbim.bim.handler.refresh_ui_data()
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class BIM_OT_cityjson2ifc(Operator):
|
|||||||
"lod": props.lod,
|
"lod": props.lod,
|
||||||
"split": props.split_lod,
|
"split": props.split_lod,
|
||||||
}
|
}
|
||||||
if props.name is not "":
|
if props.name != "":
|
||||||
data["name_attribute"] = props.name
|
data["name_attribute"] = props.name
|
||||||
|
|
||||||
converter = Cityjson2ifc()
|
converter = Cityjson2ifc()
|
||||||
|
|||||||
@@ -176,20 +176,19 @@ class EnablePsetEditing(bpy.types.Operator):
|
|||||||
new.set_value(new.get_value_default() if new.is_null else value)
|
new.set_value(new.get_value_default() if new.is_null else value)
|
||||||
|
|
||||||
|
|
||||||
class DisablePsetEditing(bpy.types.Operator):
|
class DisablePsetEditing(bpy.types.Operator, Operator):
|
||||||
bl_idname = "bim.disable_pset_editing"
|
bl_idname = "bim.disable_pset_editing"
|
||||||
bl_label = "Disable Pset Editing"
|
bl_label = "Disable Pset Editing"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
obj: bpy.props.StringProperty()
|
obj: bpy.props.StringProperty()
|
||||||
obj_type: bpy.props.StringProperty()
|
obj_type: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
def _execute(self, context):
|
||||||
props = get_pset_props(context, self.obj, self.obj_type)
|
props = get_pset_props(context, self.obj, self.obj_type)
|
||||||
props.active_pset_id = 0
|
props.active_pset_id = 0
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class EditPset(bpy.types.Operator):
|
class EditPset(bpy.types.Operator, Operator):
|
||||||
bl_idname = "bim.edit_pset"
|
bl_idname = "bim.edit_pset"
|
||||||
bl_label = "Edit Pset"
|
bl_label = "Edit Pset"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
@@ -198,9 +197,6 @@ class EditPset(bpy.types.Operator):
|
|||||||
pset_id: bpy.props.IntProperty()
|
pset_id: bpy.props.IntProperty()
|
||||||
properties: bpy.props.StringProperty()
|
properties: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
return IfcStore.execute_ifc_operator(self, context)
|
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
props = get_pset_props(context, self.obj, self.obj_type)
|
props = get_pset_props(context, self.obj, self.obj_type)
|
||||||
@@ -242,10 +238,9 @@ class EditPset(bpy.types.Operator):
|
|||||||
CostData.purge()
|
CostData.purge()
|
||||||
Data.load(IfcStore.get_file(), ifc_definition_id)
|
Data.load(IfcStore.get_file(), ifc_definition_id)
|
||||||
bpy.ops.bim.disable_pset_editing(obj=self.obj, obj_type=self.obj_type)
|
bpy.ops.bim.disable_pset_editing(obj=self.obj, obj_type=self.obj_type)
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class RemovePset(bpy.types.Operator):
|
class RemovePset(bpy.types.Operator, Operator):
|
||||||
bl_idname = "bim.remove_pset"
|
bl_idname = "bim.remove_pset"
|
||||||
bl_label = "Remove Pset"
|
bl_label = "Remove Pset"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
@@ -253,9 +248,6 @@ class RemovePset(bpy.types.Operator):
|
|||||||
obj: bpy.props.StringProperty()
|
obj: bpy.props.StringProperty()
|
||||||
obj_type: bpy.props.StringProperty()
|
obj_type: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
return IfcStore.execute_ifc_operator(self, context)
|
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
props = get_pset_props(context, self.obj, self.obj_type)
|
props = get_pset_props(context, self.obj, self.obj_type)
|
||||||
@@ -269,19 +261,15 @@ class RemovePset(bpy.types.Operator):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
Data.load(IfcStore.get_file(), ifc_definition_id)
|
Data.load(IfcStore.get_file(), ifc_definition_id)
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class AddPset(bpy.types.Operator):
|
class AddPset(bpy.types.Operator, Operator):
|
||||||
bl_idname = "bim.add_pset"
|
bl_idname = "bim.add_pset"
|
||||||
bl_label = "Add Pset"
|
bl_label = "Add Pset"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
obj: bpy.props.StringProperty()
|
obj: bpy.props.StringProperty()
|
||||||
obj_type: bpy.props.StringProperty()
|
obj_type: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
return IfcStore.execute_ifc_operator(self, context)
|
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
pset_name = get_pset_props(context, self.obj, self.obj_type).pset_name
|
pset_name = get_pset_props(context, self.obj, self.obj_type).pset_name
|
||||||
@@ -297,19 +285,15 @@ class AddPset(bpy.types.Operator):
|
|||||||
if pset_name in blenderbim.bim.schema.ifc.psetqto.get_applicable_names(element.is_a(), pset_only=True):
|
if pset_name in blenderbim.bim.schema.ifc.psetqto.get_applicable_names(element.is_a(), pset_only=True):
|
||||||
ifcopenshell.api.run("pset.add_pset", self.file, product=element, name=pset_name)
|
ifcopenshell.api.run("pset.add_pset", self.file, product=element, name=pset_name)
|
||||||
Data.load(IfcStore.get_file(), ifc_definition_id)
|
Data.load(IfcStore.get_file(), ifc_definition_id)
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class AddQto(bpy.types.Operator):
|
class AddQto(bpy.types.Operator, Operator):
|
||||||
bl_idname = "bim.add_qto"
|
bl_idname = "bim.add_qto"
|
||||||
bl_label = "Add Qto"
|
bl_label = "Add Qto"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
obj: bpy.props.StringProperty()
|
obj: bpy.props.StringProperty()
|
||||||
obj_type: bpy.props.StringProperty()
|
obj_type: bpy.props.StringProperty()
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
return IfcStore.execute_ifc_operator(self, context)
|
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
props = get_pset_props(context, self.obj, self.obj_type)
|
props = get_pset_props(context, self.obj, self.obj_type)
|
||||||
@@ -323,7 +307,6 @@ class AddQto(bpy.types.Operator):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
Data.load(IfcStore.get_file(), ifc_definition_id)
|
Data.load(IfcStore.get_file(), ifc_definition_id)
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class GuessQuantity(bpy.types.Operator):
|
class GuessQuantity(bpy.types.Operator):
|
||||||
|
|||||||
Reference in New Issue
Block a user