Save Geometry with Button

SaveGeometry.gh (7.2 KB)

Hey there
I’m trying to make a component that can save or rather send geometry to a Geometry Parameter (by Nickname) with a Button click. I used a Python Script from someone who did the same thing but to send text to a Panel. I tried to make some changes so it can do what i want it to do but after i dont no much about working with Python i got stuck.
I need this component for Human UI so that i can save the data i pick with the Rhino Pick Button
Thanks in advance

Moved to Grasshopper category.

Thanks

import Grasshopper as gh
def SetData():
    for obj in ghenv.Component.OnPingDocument().Objects: 
        if obj.NickName in _Name:
            obj.PersistentData.Clear()
            obj.PersistentData.Append(gh.Kernel.Types.GH_Curve(_Geometry))
            obj.ExpireSolution(True)
if _Set:
    SetData()
1 Like

Thank you so much, it works perfect

One more question:
What do i have to do so i can use it for multiple curves?

2022-07-05_22-49-54

import Grasshopper as gh
if run:
    for obj in ghenv.Component.OnPingDocument().Objects:
        if obj.NickName not in name: continue
        obj.PersistentData.Clear()
        for crv in crvs:
            obj.PersistentData.Append(gh.Kernel.Types.GH_Curve(crv))
        obj.ExpireSolution(True)
        break

PersistentData.gh (7.7 KB)

2 Likes

Awesome
Thank you so much