I’m having a issue with the commands in my custom plugin when trying to use them in a macro: when I run a macro like this:
! _CreateSplashes _Distance 15 _Height 4
it works great if I don’t have any pre-selection. If I do have a pre-selection, I get a bunch of “Unknown command” messages for each one of the options I’m trying to set. My understanding is that, because of the pre-selection, my GetObject.Get is returning GetResult.Object right away, without setting the options first. What’s the best way around this (if there is any)? I’d like my commands’ options to be settable in a macro, just like the native commands are.
Also, you object getter can tell you whether or not object were pre-selected. So you could check this an, if so, prompt for the options.
var go = new GetObject();
go.GetMultiple(1, 0);
if (go.CommandResult() == Result.Success)
{
if (go.ObjectsWerePreselected)
{
// TODO: prompt for options here (too)
}
}
I would like to void using _SelNone, it kind of defeats the purpose of preselection.
I did think of checking ObjectsWerePreselected in case of success, but how do I query for options here, once the command has been run? Do I loop GetString and switch to match my options? Or is there a better way of handling it? (I actually don’t even know if the loop idea makes any sense at all…)