Grasshopper

algorithmic modeling for Rhino

Hi Everyone

I use python to read the panel in time. I encountered two minor problems.

1:How to extract gh_panel value?

2:How to use the obj. SetValue?

Any help or insight on this would be great,

    Thanks!!!

Views: 1902

Attachments:

Replies to This Discussion

To get the value to you need the .UserText property. To set new values, use .SetUserText.

Currently setting new values will change all the panels. You will need to add a few more lines of code if you wish to set unique text to each panel. Also, because the script picked up all the panels on the canvas (including the ones connected to the Python outputs), I made an input that contains a list of the panel NickNames you want to operate on. This helped, but may not be what you want.

See attached.

/SPM

Attachments:

Hi Stephen P.Maher

Thank you very much for your answer,The perfect solution to my first question.You can solve the second problem?

Thanks again.

/NARUTO

Naruto,

Can you clarify what you're looking for exactly? (An image or diagram might be helpful.) The definition I attached earlier allows the user to replace the Panel's text with another using .SetUserText. Or are you specifically curious how .SetValue works?

/SPM

Yes,I just specifically curious how .SetValue works

I'd encourage you to check out the Grasshopper SDK documentation.

Hi Stephen P.Maher

I am very sorry,I am useless articulate my question.exactly,I just specifically curious, how access protected member  works.Thank you very much/SPM

What are you trying to do exactly? SetValue may not be what you want.

The attached definition now allows you set unique UserText using list logic.

Whoops, here's the correct file.

Attachments:

Hi SPM,Thanks you very much

Can this work with a "list" as well?  For example, instead of one value per panel, could you pass in a list of values, and have them written/stored to one panel as a list?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service