1
Scripts and Plugin Help / Re: Get Directory of opened file
« on: February 05, 2023, 16:03:40 pm »
After hours of object browsing and trying dozens of alternatives, here is the best I could find.
It requires one more user interaction than I would like, but it's acceptable.
It requires one more user interaction than I would like, but it's acceptable.
Code: [Select]
from CamBam.CAM import *
from CamBam.UI import CamBamUI
CamBamUI.MainUI.OpenFile() # async
doc.Save() # Does two things: 1) gets the folder of the .dxf 2) awaits async OpenFile
print doc.Filename, doc.Name # after Save this has the correct full Path but the old Name
view = CamBamUI.MainUI.ActiveView
newdoc = view.CADFile
print newdoc.Filename, newdoc.Name # the newdoc has Path of None, but the correct Name