How to get file path of current GH/Rhino file?

Any existing component or code?

If you don’t provide a path, the output will be the path of the GH file if it has been saved Relative Path - MetaHopper - Component for Grasshopper | Grasshopper Docs

1 Like

for the rhino filepath you can use

from Rhino import RhinoDoc
a  = RhinoDoc.ActiveDoc.Path

in a python node. This will return null if the file has not been saved yet

2 Likes

For Grasshopper, @RIL posted a really simple solution using the C# component:

A = GrasshopperDocument.FilePath;

Hope this is of use.

Ash

1 Like