Bug or Wish, Selection Command and Scripting Inconsistencies

@BrianJ We had some pretty bad errors happening due to inconsistencies in how some of the selection commands select across layout views.

Select only in active layout view

  • SelAll
  • SelLayer

Select across layout views

  • SelName
  • Scripting: rhinoscriptsyntax.ObjectsByLayer(guid, True)

I did not check other selection commands yet.

I think this should be unified. We had texts and dimensions wiped across layouts because of this when: User wants to delete some unnamed objects on a layout: Executes command SelName on active layout, chooses “No name”, hits delete. Error is detected only days later, when other layouts are printed which are now missing text/dims/etc. → disaster because file is many revisions ahead.

Generally speaking, I think one should never be able to select things beyond the currently active view/layout, or only be allowed to do so after a warning.

(EDIT: In some files but not all SelName also reaches from model space to layout space, see other posts below with video)

Hi Silvano - I’ll check this, thanks.

Here, SelName respects the ‘space’. It does not select objects in model space if a layout is active. It selects from model space if a detail is active. SelLayer seems the same so far. Am I missing the point?

@silvano - are we just looking at selection via rhinoscriptsyntax and not top level Rhino commands? It looks like the bug would be in IsVisibleInView(), correct?

-Pascal

@pascal Addendum: I wanted to script around those inconsistencies using rs.IsVisibleInView() and discovered more strange behavior here. Please see the video and test file and script below.

I hope this is not intended.

sel_debug.py (596 Bytes)
sel_debug.3dm (5.3 MB)

Content of above script

import rhinoscriptsyntax as rs


def main():
    obj = rs.GetObject("Select object", preselect=True)
    res_objs = rs.ObjectsByLayer(rs.ObjectLayer(obj), False)
    
    # Filter
    view = rs.CurrentView()
    res_objs = [o for o in res_objs if rs.IsVisibleInView(o, view)]
    
    # Test
    print("View name: {0}".format(view))
    for o in res_objs:
        print("Object name: {0}, Visible: {1}".format(
                rs.ObjectName(o), rs.IsVisibleInView(o, view)))

    rs.UnselectAllObjects()
    rs.SelectObjects(res_objs)


if __name__=='__main__':
    main()

Correction to my original post: This happens only across layout views. Space is respected. I have no idea, how I thought I saw it reaching from model to layout space. I edited the original post.

Nevertheless, selecting across layout views is what caused our original frustration. This is true for both, Rhino command SelName and rhinoscriptsyntax.IsVisibleInView(). To me the behavior of IsVisibleInView() is odd.

Do I understand correctly that a layout at the same time represents a view. It looks like this when using rs.CurrentView().

Thanks for your prompt response, by the way :slight_smile:

@pascal To add to the complete confusion: I was not mistaken in my original post. In my actual working file, SelName reaches from model space into layout space. Please see video below. I execute:

  • _SelName → Objects on layouts are selected (1 block, 2 detail views, 4 leaders, etc.)
  • _Delete → Objects on layouts are deleted
  • Switch to layout view, empty layout shown
  • _Undo → Objects on layout that were deleted are back

Unfortunately I cannot share this file here in the forum.

Hi Silvano - I see that ‘no name’ selects everywhere. Thanks.
RH-77632 SelName inconsistencies

-Pascal

2 Likes