I’ve stumbled across a rather perplexing issue whereby any geometry I create (using rs.Addxxx methods) as part of an object (of a class) doesn’t seem to transfer to another Python node correctly.
I have a process where one Python node creates a class, does a heap of stuff, and as part of a bigger process, creates some grasshopper geometry.
I then have another node which takes that object as an input and tried to extract the variables from that object. While this works fine for most variables, it doesn’t seem to work for grasshopper geometry. I’ve recreated the type of issue in a smaller process below. Note that when I un-comment line 13 of the second node, an exception is raised:
That works because you’re just recreating the line in the second node, and ignoring what comes in from the first node. Your output at b is the new line, not the line which came in from the first node (from foo)
Try to implement RhinoCommon directly (i.e. Rhino.Geometry.Line). The whole rhinoscriptsyntax GUID hoopla is likely to cause all sorts of unexpected behaviour when you make them class properties and send these through wires.
OK, will give that a go, thanks. I find RhinoCommon more difficult to implement as it is so much larger than rhinoscriptsyntax. Can you help find a few other equivalent commands? I need one for rs.AddPlanarSurface.
Thanks, but that’s the wrong command - that one builds a rectangular surface on a plane by taking a plane and X & Y extents. rs.AddPlanarSurface creates a planar surface by defining planar curves. The equivalent RhinoCommon command is Rhino.Geometry.Brep.CreatePlanarBreps() - Brep.CreatePlanarBreps Method (Curve, Double)