Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8532

Selection Bug in GetObjects

$
0
0

@karld wrote:

Hi Rhino Team,

I keep running in problems selecting/deselecting objects in picking mode.
If there is any object pre-selected, it can not be altered in picking mode again without closing and re-opening picking mode. The problem appears both in Rhino 5 and Rhino 6, with the difference being Rhino 5 using “Version 1” and Rhino 6 using "Version 4"
“Version 4” is the best solution I could find till now, but it still is inconvenient not being able to see the pre-selected objects.
I’ve tried the four following codes snippets but none of them works as it should. (Only changes two parameters)

#########
Version 1
Original code
#########

 while (true)
            {
                go.GetMultiple(1, 0);
                if (go.CommandResult() != Rhino.Commands.Result.Success)
                {
                    return null;
                }

                var canBreak = true;
                if (go.ObjectsWerePreselected)
                {
                    go.EnablePreSelect(false, false);
                    go.EnableClearObjectsOnEntry(false);
                    go.DeselectAllBeforePostSelect = false;

                    canBreak = false;
                }


                if (!multiple && go.ObjectCount > 1)
                {
                    go.SetCommandPrompt("Please make sure you select one item: " + message);

                    canBreak = false;
                }

                if (canBreak)
                {
                    break;
                }
            }

Pre-selected objects cannot be selected/deselected at all

#########
Version 2
#########

while (true)
            {
                go.GetMultiple(1, 0);
                if (go.CommandResult() != Rhino.Commands.Result.Success)
                {
                    return null;
                }

                var canBreak = true;
                if (go.ObjectsWerePreselected)
                {
                    go.EnablePreSelect(false, false);
                    go.EnableClearObjectsOnEntry(false);
                    go.DeselectAllBeforePostSelect = true;


                    canBreak = false;
                }


                if (!multiple && go.ObjectCount > 1)
                {
                    go.SetCommandPrompt("Please make sure you select one item: " + message);

                    canBreak = false;
                }

                if (canBreak)
                {
                    break;
                }
            }

Pre-selection can not be selected/deselected. Only after deselecting all and selecting all again single surfaces can be selected again.

#########
Version 3
#########

while (true)
            {
                go.GetMultiple(1, 0);
                if (go.CommandResult() != Rhino.Commands.Result.Success)
                {
                    return null;
                }

                var canBreak = true;
                if (go.ObjectsWerePreselected)
                {
                    go.EnablePreSelect(false, false);
                    go.EnableClearObjectsOnEntry(true);
                    go.DeselectAllBeforePostSelect = false;

                    canBreak = false;
                }


                if (!multiple && go.ObjectCount > 1)
                {
                    go.SetCommandPrompt("Please make sure you select one item: " + message);

                    canBreak = false;
                }

                if (canBreak)
                {
                    break;
                }
            }

Pre-selected object can not be deselected at all in current picking mode. Deselection tool works as selection tool on deselected objects

#########
Version 4
#########

while (true)
            {
                go.GetMultiple(1, 0);
                if (go.CommandResult() != Rhino.Commands.Result.Success)
                {
                    return null;
                }

                var canBreak = true;
                if (go.ObjectsWerePreselected)
                {
                    go.EnablePreSelect(false, false);
                    go.EnableClearObjectsOnEntry(true);
                    go.DeselectAllBeforePostSelect = true;


                    canBreak = false;
                }


                if (!multiple && go.ObjectCount > 1)
                {
                    go.SetCommandPrompt("Please make sure you select one item: " + message);

                    canBreak = false;
                }

                if (canBreak)
                {
                    break;
                }
            }

Pre-selected objects can be selected/deselected, but every pre-selected object becomes deselected once picking mode is entered

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 8532

Trending Articles