Hi all,
sorry for likely incorrect terms, but hopefully the idea will be clear to everybody.
I have a python node, in which I use rs.Command() function to execute my request to a custom plugin. The command generates a pair of curves. Then I can obtain the newly created objects in the document space by rs.LastCreatedObjects() to manipulate them as any other already existing document’s object. But what should I do with those objects to move those curves from the document’s space to the grasshopper’s? In other words, I need a kind of “reversed baking”. Thanks!
LastCreatedObjects() should return an array of identifiers.
In rhinoscript you can convert each identifier to a string with CStr(identifier) , not sure how with python…
If you send that string to grasshopper, you can feed it to a “Geometry” parameter:
Or if you have the identifier/string inside your c# plugin, you can use it like:
RhinoObject obj = this.RhinoDocument.Objects.FindId((Guid) yourstringhere);
(here is a string casted to Guid)
Thank you very much for the reply! Actually, it is not exactly what I mean. Sorry if my explanation is not clear. I’ve tried an approach similar to yours - just enumerated the objects received from LastCreatedObjects() and fed them to the two curve nodes. Thus, of course, I can use these curves in further nodes. But what I am looking for is rather the following: how to detach the result of the command from the document space and make it live only in grasshoper, as if it were a result of, for example, genuine grasshopper’s Line node. The rationale for that is to protect the generated curves from accident deletion or change in the Rhino’s main view. Thanks!
Thank you very much! The result looks pretty much like what I wanted, but I have no idea about C# =) will try to study the code and adapt it to my project