Thanks for mentioning that. You saved me the trouble of re-typing your code, which in itself is a waste of time, all the more so because it won’t work in Rhino 5. Can anyone provide a Rhino 5 solution? Seems like a very reasonable question to me,
this works! You need to feed in an Rhino Object with a “guid” parameter, not an “surface” parameter. Surface, Breps etc won’t have any information about layer, color etc…
Its the RhinoObject who holds an geometric object (GeometryBase)
@TomTom, can you post working code please? I’m just being a dilettante on this but am surprised that a working answer hasn’t been provided for this question yet.
@clement, I get the same error as before using this type hint with a ‘Geo’ param:
I meant that I replaced the ‘Srf’ param with a ‘Geo’ param (which is set to a Rhino surface) - separate issue from type hint. As I said, this isn’t my issue, I’m just trying to follow along.
There is a little more info in the definition. Basically, “Type Hint” does, inside the component, the same as what a ID param + No Hint would do. This is always the case, for any param.
I hope this helps,
Giulio
–
Giulio Piacentino
for Robert McNeel & Associates giulio@mcneel.com
Please open the file above (layers.gh) in Rhino 5 for a working example. You’ll need, of course, to reset the ID param to an object that exists in the Rhino doc. The Guid type hint did not exist in Rhino 5, it was added in the Rhino 6 WIP. The str type hint can be used, too, but it needs a Guid (not geometry).