mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix #4411. Fallback to absolute paths if relative paths fail.
This commit is contained in:
@@ -860,7 +860,10 @@ class LinkIfc(bpy.types.Operator):
|
|||||||
continue
|
continue
|
||||||
new = context.scene.BIMProjectProperties.links.add()
|
new = context.scene.BIMProjectProperties.links.add()
|
||||||
if self.use_relative_path:
|
if self.use_relative_path:
|
||||||
filepath = os.path.relpath(filepath, bpy.path.abspath("//")).replace("\\", "/")
|
try:
|
||||||
|
filepath = os.path.relpath(filepath, bpy.path.abspath("//")).replace("\\", "/")
|
||||||
|
except:
|
||||||
|
pass # Perhaps on another drive or something
|
||||||
new.name = filepath
|
new.name = filepath
|
||||||
bpy.ops.bim.load_link(filepath=filepath, false_origin=self.false_origin)
|
bpy.ops.bim.load_link(filepath=filepath, false_origin=self.false_origin)
|
||||||
print(f"Finished linking {len(files)} IFCs", time.time() - start)
|
print(f"Finished linking {len(files)} IFCs", time.time() - start)
|
||||||
|
|||||||
Reference in New Issue
Block a user