How to get Dynamo script's file name in Dynamo for Civil 3D

I want to do some loggings and I need the Dynamo script file name. I know there is some Python code for Revit. But I need it to work for Civil 3D.


I am actually working on the same thing right now haha. Here you go:

import clr

from Autodesk.AutoCAD.DynamoApp import *
# Gets Dynamo instance so the active script can be recorded

def GetGraphNameCivil3D():
	DynamoModel = AcDynamoRuntime.DynamoModel
	DynamoWorkspace = DynamoModel.CurrentWorkspace
	return DynamoWorkspace.FileName

#Define Output (OUT)
OUT = GetGraphNameCivil3D()

Hey Joël,

Thanks a lot!

I am curious how you figgered it out. :smirk:

We are using this Dynamo script name with other parameters for logging purposes.

Kind regards, Edward

Haha, a lot of peeking in the Civil dll’s and experience with the Dynamo API


Thanks for your effort @Joelmick

Finally got this function implemented innovera enviroment.
Thanks again :slight_smile: