Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5791

GetObjects options not shown when objects are preselected

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 5791

Trending Articles