Grasshopper

algorithmic modeling for Rhino

I am going to start a new thread for this as it is different to the original title.

http://www.grasshopper3d.com/forum/topics/parameter-must-be-a-guid-...

The problem as says in the title. I am using the following code:

import rhinoscriptsyntax as rs

ResetObjs = rs.GetObjects("Game Over -- Click to Restart",8,True,True,True)
for Objs in ResetObjs:
ReStart = rs.IsObjectSelectable(Objs)
ReStart2 = rs.IsObjectSelected(Objs)
print ReStart
print ReStart2

for this I get back a 'true' for IsObjectSelectable and '2' for IsObjectSelected.

I have asked the advice of colleagues and checked documentation, but I cannot find out what the value '2' is telling me. I have also tried this in both python in grasshopper and in rhino to see if that was the issue.

any light shed on this situation would be very much appreciated.

Cheers!

Paul.

Views: 443

Replies to This Discussion

Hi Paul

in which environment are you running this? GhPython?

Grasshopper has no selection, so you can only select stuff in the Rhino document.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

So, I had a deeper look.

I'd need the answer above more in general for help, but the values mean:

/// 0 = object is not selected.
/// 1 = object is selected.
/// 2 = entire object is selected persistently.
/// 3 = one or more proper sub-objects are selected.

http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_DocObject...

I will fix the documentation for RhinoScript, too.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Thank you,

This certainly helps and gives meaning to the integer I am receiving. I am currently using GHpython and using scriptcontext to jump in and out of the rhino doc.

I will look over the code and investigate if I can fix this.

Paul

The documentation will be fixed in next week's WIP.

Note that:

if rs.IsObjectSelected(Objs):

and

if not rs.IsObjectSelected(Objs):

work in a semantically meaningful way. There is nothing particular to fix if you use this type of code.

Thanks,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

I see what you mean. It was more to achieve a noN persistently selected object, so I can get a 1 or 0. In the end I need a boolean value based on an object GUID, so I will try a different way.

Thank you for your help!

You can use "!= 0" on the return value if you want a Boolean value.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service