Minor fix

This commit is contained in:
Dion Moult
2022-08-16 11:49:24 +10:00
parent d3795c9836
commit e85f21ce7a
2 changed files with 3 additions and 1 deletions
@@ -672,7 +672,7 @@ class LinkIfc(bpy.types.Operator):
use_relative_path: bpy.props.BoolProperty(name="Use Relative Path", default=False)
def execute(self, context):
files = [self.filepath] if self.filepath else [f.name for f in self.files]
files = [f.name for f in self.files] if self.files else [self.filepath]
for filename in files:
filepath = os.path.join(self.directory, filename)
new = context.scene.BIMProjectProperties.links.add()
@@ -83,6 +83,8 @@ class SelectGlobalId(Operator):
global_id = self.global_id or props.global_id
entity = ifc_file.by_guid(global_id)
obj = tool.Ifc.get_object(entity)
if not obj:
self.report({"ERROR"}, "No object found")
obj.select_set(True)
bpy.context.view_layer.objects.active = obj
return {"FINISHED"}