I’ve been experimenting with the InstantiateNewObject method to generate Grasshopper components by name (through their component id) similar to this thread:
This method doesn’t include components in the Grasshopper.dll library such as data parameters, number sliders etc. & I’m wondering if there is a similar method in the Grasshopper API that enables addition of these types by name also?
Hi Sean.
May I ask you why you want to do so?
On different versions of grasshopper, newer versions of components have the same name but behave differently (sometime). By using a specific guid you can be sure to call a specific version of a component, using the name would be less reliable… maybe.
The use case was to build a prototype that could allow Chat GPT to declare components required to build a specified algorithm, in theory creating a scenario that would generate grasshopper algorithms conversationally at the click of a button. I ended up figuring it out (you can see it in action here Chat GPT for Grasshopper - YouTube) , but it has the issue you’re describing in that it calls older components with the same name. Served my purpose as a prototype though!