How can I run a rhino python / rhino command to set one curve for a grasshopper curve parameter?

Hi all,

As the title said, how can I run a rhino python / rhino command to set one curve for a specific grasshopper curve parameter? I am using an amazing plug-in call Human UI. It provides a button that I can run a rhino python / rhino command to do something. And I want to do is, when user press this button, it would prompt user to set one curve for a grasshopper curve parameter.
Is there any existing python code can do that?


Appreciate for any suggestions,

Jack

Assigned to Grasshopper category

I guess I have explained it a bit complicated, actually I just need to know how to use rhino python to pick a curve for a grasshopper component. Like this.


Wondering if there is any easy way to do that?
Thanks,

You want to set the parameter’s PersistentData and here is a working example for a few points. On GH3d.com I just found one thread and didn’t get an answer myself.

So, you should perhaps ask David how much you should (not) want to do that…

@Jack_Zeng, have you seen this ?

c.

Seems it is a bit more complicate then I expect… I will take some time to digest.
Thanks a lot Marcus!! :grin:

Thank you clement, I will give it a shot~ :laughing:

I am trying to do the exact same thing.
What I basicly want to do is that when the toggle is set to true the python script triggers the same command as when you right click on a curve component and selects “set one curve”.

Is there a grasshopper SDK for this? https://developer.rhino3d.com/api/grasshopper/html/723c01da-9986-4db2-8f53-6f3a7494df75.htm

@agi.andre, you might try below to reference a curve:

_
c.

Thank you @clement ! That worked just fine :slight_smile:

I’m trying to take this one step further and looking for a way to activate/simulate the “Set one 2D curve in ARCHICAD” for a specific component through Python or C#.
Anyone familiar with the Grasshopper.Kernel SDK [url]https://developer.rhino3d.com/wip/api/grasshopper/html/723c01da-9986-4db2-8f53-6f3a7494df75.htm[/url] and know how to prompt this command?

Explaination:

  1. User clicks the toogle button and send a “True” boolean to Python/C# script
  2. Python/C# component triggers the “Set one 2D curve in ARCHICAD” for selected component
  3. User is directed to ARCHICAD to select one curve (same as happens when you right click on component and selects “Set one 2D curve in ARCHICAD”

I’ve been reding about controlling grasshopper components through code here:
[url]http://james-ramsden.com/grasshopper-without-wires-transmit-data-to-any-component/[/url]
http://james-ramsden.com/force-a-component-to-re-compute-in-grasshopper/
[url]http://james-ramsden.com/read-and-edit-persistent-data-in-grasshopper-components/[/url]

Anyone who can help me out with this?
Thanks!