Get the Dynamo File Path or Name

Hi guys,

I really like where this topic is going. These are some great tips on management techniques! Jeff I just love that improv graph builder.

Unfortunately, from what I understand, it’s impossible to get the name of the active workspace from a python node because the node resides in an entirely separate scope. Tho we can try to be creative and instead probe the log files. Dynamo logs almost everything and you can find those logs in the following path:

%appdata%\Dynamo.9\Logs

The below script fetches the latest log and searches for the latest save event. A graph open event does not get logged for some weird reason but luckily a save event does. We can use that to our advantage. If the user saves the file immediately after execution ( possibly not a good idea if they’ve made any changes? ), the script will read the path from that event and report it.

The above is also a great demonstration on why you should never have spaces in your file paths :} A ZT node might be able to get access to the active workspace but I don’t plan on spending my weekend trying to find that out.

2 Likes