Select every objects in a script

rhino

(Amineboussoualim) #1

Hi, i want to know how to select every object with rhinoscript, like doing a Ctrl + A, i tried this whitout succes :

Dim arrObjects
arrObjects = Rhino.AllObjects
Rhino.SelectObjects arrObjects


(Willem Derks) #2

Hi,

Try to use NormalObjects to avoid passing locked or hidden objects

	Dim arrObjects
	arrObjects = Rhino.NormalObjects
	Rhino.SelectObjects arrObjects

Does this help?
_Willem


(Amineboussoualim) #3

Thank you for your answer but i finnaly figured it out minutes after i posted.
I just used Rhino.Command("ToutSelectionner") (french for SelectAll)


#4

I think all you need to do is enclose arrObjects with parenthesis.

Dim arrObjects
arrObjects = Rhino.AllObjects
Rhino.SelectObjects (arrObjects)


(Dale Fugier) #5

@DanBayn, his syntax is correct.

You can do this:

Dim arrObjects
arrObjects = Rhino.AllObjects
Rhino.SelectObjects arrObjects

or this:

Dim arrObjects
arrObjects = Rhino.AllObjects
Call Rhino.SelectObjects(arrObjects) 

– Dale


#6

Yes, now I recall using Call. I guess I’ve been away from VB for too long.


#7

@amineboussoualim,

you can also just use the first argument of Rhino.AllObjects to select without the need of calling Rhino.SelectObjects. Below will also include light objects (the second argument):

Dim arrObjects
Rhino.AllObjects True, True, False

_
c.