generative modeling for Rhino
I have a block in Rhino which I select in grasshopper as a Geometry Parameter. I then use this parameter as an input into a Python module. How do I get the GUID of this input parameter? I only really ever use rhinoscriptsyntax. I assume I have to use rhinocommon or something else?
It is not possible to know this. Grasshopper works with pure geometry, and often it does not keep track of where it came from (if it was a line from the document or it is just a connection of two points, for example).
So my suggestion would be to:
1. Upgrade to the latest GhPython
2. Use the Guid component in Grasshopper to link to the Guid's of objects
3. Input the Guid into GhPython. Convert the Guid into a string if you want the Guid as text in the outputs.
I hope this helps,
This does help but when I add
name = rs.BlockInstanceName(a)
I get an error "unable to find instance object." I wanted to use the GUID to get the block name so I could use rs.InsertBlock(name, [5,5,5])
I assume this has to do what you said in my previous post that Grasshopper does not have access to the object information that exists in the Rhino document.
Is there away around this or should I abandon doing this in Grasshopper and just write the code in the Rhino document?
Hi again Jon
getting the ID from the geometry is not a standard operation, but you can work around this by keeping track of the ID and then move around the geometry from the Rhino document into Grasshopper.
Here is an example,
I hope it helps,
I am starting to get the feeling that since I don't "need" the functionality of grasshopper I would be better off just writing a python script in the Rhino environment. I appreciate the help though. Also, it has helped me understand how the two environments interact. very interesting.