Instead I’d like to run a custom command in Rhino that adds the two selected curves to a designated curve parameter in GH. I’d also like to have the inverse command that deletes two selected curves from the aformentioned curve list in GH.
I’m looking for some C# examples of how to pass data from a Rhino command to GH. The below answer is the closest I’ve found, but I was hoping for some actual code to examine since I’m very new to C#.
Yes, I tried something similar to that with geometry pipeline. The problem is that the connections between cards require information about which two cards are connected (and I want the initial connections to be maintained when I add new connections). The only way I currently know to do this is to add them as pairs to a list (the same cards appear multiple times in this list), dispatch the list, and then filter from another list of all cards in the document by user attributes.
Mahdiyar–I tried your python script and it does indeed do exactly what I want, so thanks!
The only issue I’m having is that AssignDataToParameter deletes all previous data in the parameter, instead of just adding the data to the existing list, which is the behavior I want. I don’t see AddDataToParameter (or something similar) as an option in the Grasshopper documentation.
Do you know if there’s another method I’m missing?
import rhinoscriptsyntax as rs
from Grasshopper import Instances, Kernel
from System import Guid
gh = rs.GetPlugInObject('Grasshopper')
param_id = Guid('2a9de3cc-633f-486f-b97f-e2e53c954952')
doc = Instances.ActiveCanvas.Document
param = doc.FindObject(param_id, True)
ids = rs.GetObjects('Select curves', rs.filter.curve)
for id in ids: