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

RC - subobject selection routine problems

$
0
0

@Helvetosaur wrote:

Trying to be able to select some subobjects via RhinoCommon and have them remain selected once the Get() operation is finished. So far, all I figured out how to do is have the whole object selected.

The second problem is (with the snippet below) that despite the fact that both surface edges and faces are enabled, I can only get the faces - If I zoom in close and try to pick an edge, the multi-selection box only indicates faces, no edges in the list.

import Rhino

def TestSO(prompt):
    go = Rhino.Input.Custom.GetObject()
    go.SetCommandPrompt(prompt)
    filt=Rhino.DocObjects.ObjectType.Curve | Rhino.DocObjects.ObjectType.Surface
    go.GeometryFilter=filt
    go.SubObjectSelect=True
    go.GetMultiple(1,0)
    if go.CommandResult()!=Rhino.Commands.Result.Success:
        return go.CommandResult()
    objrefs = go.Objects()
    if not objrefs: return Rhino.Commands.Result.Nothing
    rc=[]
    for objref in objrefs:
        indices=[item.Index for item in objref.Object().GetSelectedSubObjects()]
        #objref.Object().Select(True)  <-- selects the whole base object
        rc.append([objref.ObjectId,indices])
    return rc

result=TestSO("Select sub objects")
pass

image

What am I missing here?

TIA, --Mitch

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4117

Trending Articles