I have a GH definition that measures the length of intersections between a (baked) SubD object and some planes.
The problem is that when I mesh the SubD in Rhino, a mesh is created with the same name, layer and colour, and is picked up by my GH definition and starts computing the length of the same intersection as with the SubD.
And when I forget to pause this GH definition before I mesh my SubD object in Rhino (and that happens a lot…), Rhino freezes for some time.
Geometry Pipeline also recognises a SubD object as a mesh.
Any tips how I can let GH reference to a SubD object only, when there is also a mesh with the same attributes?
Filter by type with either EleFront in Rhino 7 or use the new Grasshopper Rhino components in Rhino 8.
Filter by type in Elefront does not show SubD as a type in the value list.
Thanks Martin, but my understanding of Python and GHPython script is not enough to get this working.
Would you please give a more step by step explanation?
Thanks in advance,
Erik
With c# is more obvious:
c# IsSubD.gh (12.0 KB)
private void RunScript(GeometryBase geo, ref object IsSubD)
{
IsSubD = geo.ObjectType == Rhino.DocObjects.ObjectType.SubD;
}
2 Likes
Thank you Riccardo!
I do not know how to create a script that actually works since I miss basic knowledge, but your definition simply works for me!