Rhino file path in grasshopper

Is there a way for a grasshopper definition to get the location of the open/active rhino file?
I want to use it to set the default folder for LadyBug so everything gets saved with the rhino project file…

Can it be done?

With c# you can use this.RhinoDocument.Path method.

c# rhino document path.gh (4.2 KB)

Remember to retrigger the c# component if the rhino document changes.


Thank you…!