Hello,
Im looking to make a preferably C# component in Grasshopper that when toggled by a Button saves the active Rhino Document.
Thank you,
Hello,
Im looking to make a preferably C# component in Grasshopper that when toggled by a Button saves the active Rhino Document.
Thank you,
Doe any of this help?
You can write out ActiveDoc.
This is what i tried
https://developer.rhino3d.com/api/rhinocommon/rhino.rhinodoc/save?version=8.x
private void RunScript(bool Check, ref object SaveRhino)
{
//Save Rhino File
SaveRhino = RhinoDoc.ActiveDoc.Save(Check);
}
This is the error i got “1. Error (CS1501): No overload for method ‘Save’ takes 1 arguments (line 71)”
Not sure what to do here.
The method doesn’t take any arguments, but returns a boolean. Here’s a quick GHPython example that also checks if the file has been saved first:
Edit: The Save
method appears to return false, but one can script the _Save
command as a workaround:
In case you’re solely after a C# block.
Input to the C# block:
path(string) = Full path name with file extension
run(bool) = Boolean toggle
Personally I would use GhPython like AndersDeleuran above if it’s needed on the spot.
Nice one - thankyou. How’ve you managed to avoid “Old” from displaying over the top of the component, may I ask?