I learned how to create and use command bar options in c#, and everything works. Something I’d like to change is not having to input the same option over and over again, if I put it once I want it to be the default in the next time I call the command. How can I do this?
Side note: where can I install Visual Studio 2005 for making 32-bit plugins?
Each command has a Settings object that you can use to store and retrieve settings. They are saved to disk after rhino quits, and restored from disk when rhino starts.
Ok, I do this code from memory, so it may be incorrect. There is a Settings property on each command. You can get and set values on it, like a dictionary.
protected Result RunCommand(RhinoDoc doc, CommandMode mode)
{
int savedInteger = Settings.GetInteger("key", 4);
Result res = RhinoGet.GetInteger("Give integer", ref savedInteger);
if (res != Result.Success) return res;
Settings.SetInteger("key", savedInteger);
return Result.Success;
}