mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix bug to prevent users from appending a project library asset twice
This commit is contained in:
@@ -153,7 +153,7 @@ class IfcImporter:
|
||||
self.settings_native.set(self.settings_native.INCLUDE_CURVES, True)
|
||||
self.settings_2d = ifcopenshell.geom.settings()
|
||||
self.settings_2d.set(self.settings_2d.INCLUDE_CURVES, True)
|
||||
self.filter_mode = "BLACKLIST"
|
||||
self.filter_mode = None
|
||||
self.include_elements = set()
|
||||
self.exclude_elements = set()
|
||||
self.project = None
|
||||
|
||||
@@ -326,6 +326,8 @@ class AppendLibraryElement(bpy.types.Operator):
|
||||
library=IfcStore.library_file,
|
||||
element=IfcStore.library_file.by_id(self.definition),
|
||||
)
|
||||
if not element:
|
||||
return {"FINISHED"}
|
||||
self.import_type_from_ifc(element, context)
|
||||
blenderbim.bim.handler.purge_module_data()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -11,7 +11,7 @@ class Usecase:
|
||||
|
||||
def execute(self):
|
||||
self.added_elements = set()
|
||||
if self.settings["element"].is_a("IfcTypeProduct"):
|
||||
if self.settings["element"].is_a("IfcTypeProduct") and not self.file.by_guid(self.settings["element"].GlobalId):
|
||||
return self.append_type_product()
|
||||
|
||||
def append_type_product(self):
|
||||
|
||||
Reference in New Issue
Block a user