Is it possible to access the "scriptcontext.sticky" of the Grasshopper Python component via C#?

Hello everyone,

I am pretty new to Python (and IronPython) and very curious to know if it is possible to access “scriptcontext.sticky” via C#?

Can someone please tell me how I can use IronPython objects in C# to interact with Python objects in Grasshopper (like PythonModule or PythonDictionary)? I mean, is there any optimal way to convert the IronPython objects - even custom objects - into the C# objects?
Can someone leave a link to a good tutorial please?
I appreciate your help in advance. :blush:

I don’t think you can access it, it’s a different language. But you can translate it.

The equivalent of the python modules would be the .dll libraries in C# ?, which you can create by compiling C# scripts in Visual Studio. For a dictionary, you can use:

Thank you Dani, I’ve updated the topic’s text.

I’m fairly familiar with C#, but I’m looking for an efficient way to use IronPython objects in order to extract the information hidden in outputs of Python components, into the .NET environment. Because I find development in the .NET environment much more manageable and transparent!
(I am also looking forward to receiving feedback about this opinion! :grinning:)

I think the information must be available in Grasshopper. The question is how to access this information via C#! :thinking:
What do mean by translation?

I don’t understand, I don’t know Python. If you only want the output data, what does python have to do with it? python’s scripting component is no different from the rest. Just iterate through the component’s output parameters and get the data, right? Or do I miss something particular about python?

https://developer.rhino3d.com/api/grasshopper/html/P_Grasshopper_Kernel_GH_Component_Params.htm
https://developer.rhino3d.com/api/grasshopper/html/P_Grasshopper_Kernel_GH_ComponentParamServer_Output.htm
https://developer.rhino3d.com/api/grasshopper/html/P_Grasshopper_Kernel_IGH_Param_VolatileData.htm

Maybe by System.Reflection or dynamic?

Could you please provide more information or explain your idea? :slightly_smiling_face: