Grasshopper action output

In Rhino if you do a command it prints out what is happening to a console. Is there something equivalent for when you set a parameter or right click on a component and choose an option from within Grasshopper?

For example if you have a mesh component and want to setMesh, is there a way to see what grasshopper is running to re-create the action programmatically?

Hi -

No. What are you trying to achieve?
-wim

I am hoping that with a list of rhino mesh objects and a mesh component I can programmatically setMultipleMeshes on that mesh component from an external python script.

Hi -
I don’t do Python but for further help, you might need to explain the “external” part a bit more. I’m sure you can use a Python component on the Grasshopper canvas to do that but it doesn’t sound like that’s what you are after.
-wim

By external script I mean from a python script that is run via Tools>PythonScript>Run. If it’s possible to do from within a python script component I might be able to adjust it to run outside of grasshopper?

Are you trying to assign data from a python script to a grasshopper parameter? If so you need to first get the parameter id:

for source in ghenv.Component.Params.Input[0].Sources:
    print source.InstanceGuid

Then, You can use GH_RhinoScriptInterface.AssignDataToParameter Method like this:

import rhinoscriptsyntax as rs
gh = rs.GetPlugInObject('Grasshopper')
param_id = 'ce39ee45-b42b-4424-9692-ca4279192003'
if gh.IsEditorLoaded():
    obj_ids = rs.GetObjects('Select meshes', rs.filter.mesh)
    if obj_ids:
        if gh.AssignDataToParameter(param_id, obj_ids):
            gh.RunSolver(True)
else:
    print 'Grasshopper is not loaded'


AssignDataToParameter.gh (14.7 KB)
AssignDataToParameter.py (360 Bytes)

That worked great, thank you!