Grasshopper

algorithmic modeling for Rhino

'Parameter must be a Guid or string representing a Guid' Help

Hi, I am having some issues with python scripting in grasshopper. For all my (limited) experience and research this should return a 'True' boolean value.

Unfortunately I keep getting the error:

'Runtime error (TypeErrorException): Parameter must be a Guid or string representing a Guid'

My print function returns:

[<System.Guid object at 0x000000000000003A [57e6def5-658b-4347-b7ad-a125509c7c97]>]

ResetObjs = rs.GetObjects("Game Over -- Click Reset", 8, False, True, None, False)
print ResetObjs

ReStart = rs.IsObjectSelected(ResetObjs)

I feel there is an obvious solution, any help will be greatly appreciated.

Also note I am doing this in the python editor in grasshopper and bobbing in and out of rhino and grasshopper using 'scriptcontext' library.

Views: 1088

Replies to This Discussion

GetObjects returns an array of objects. The clue is in the name -s, plural. IsObjectSelected expects to operate only on a single object.

You must either use GetObject(...) or loop over your ResetObjs selection.

Excellent, thank you for pointing me in the right direction. It has been a while since I have played with this.

I am now getting a value of '2' when I print the outcome of rs.IsObjectSelected. Does the mean the command hasn't worked? I was expecting a 0 or 1 at least.

I think there's more than one way for an object to be selected. Something about being persistently selected or only for the duration of a picker, and then there's sub-object-selection. I guess you'll have to look at the documentation to see what each integer represents.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service