Get Current dynamo file path

I can’t take credit for this script, I only suggested a possible solution. Credits go to @Kulkul

All is good @4bimfercesp. Thank you.
I have added the 2 parentheses as a trial to solve the same error in that line 22. So, nothing changes if 1 parentheses or two exist in the routine. Thank you for your comments. :grinning:

Hi @Andreas_Dieckmann.
Thank you for that. I did use @KulKul’s script as well, but it does not display the entire file path, including server, as I need to display. Thank you for getting back to me. :grinning:

Just wondering if you guys found the answer. I found one working for me in the Designtech library:

2 Likes

Thanks. That one should be marked as the solution…

You could utilize this python code to get the file name, do note that this uses dynamorevit so may not work in dynamo sandbox or other dynamo hosted forms(formit, civil 3d).

3 Likes

import clr
clr.AddReference(‘DynamoServices’)
from Dynamo.Events import *
OUT = ExecutionEvents.ActiveSession.CurrentWorkspacePath

This may work

1 Like

Great call back. :slight_smile:

This API was added by the team shortly after the other method became the required fallback. Hopefully this will help users to find this more stable solution going forward!

2 Likes