@mpreisig wrote:
I want to set properties of selected objects (using SetUserText). Because each object can have 5 different properties, I want to be able to select which property will be set when the user is prompted to select objects.
This works perfectly when no objects are preselected. But when objects are pre-selected, the command prompt “Select objects” with options is not shown. Why?
def RunCommand(): go = Rhino.Input.Custom.GetObject() go.GroupSelect = True go.SetCommandPrompt('Select objects') index = 0 go.AddOptionList('Property',['mat','EF','LF','rm1','rm2'],index) while True: get_rc = go.GetMultiple(1,0) if go.CommandResult()!=Rhino.Commands.Result.Success: return go.CommandResult() elif get_rc==Rhino.Input.GetResult.Option: option = go.Option() index = option.CurrentListOptionIndex elif get_rc == Rhino.Input.GetResult.Object: objs = go.Objects() setPropertyTo(index,objs) break
Posts: 2
Participants: 2