Grasshopper

algorithmic modeling for Rhino

Pass data between C# compiled components and ghPython components without wires

Dear all,

I have written my own class of the GHNumberSlider - called a SPEED slider (In C# using visual studio) I need to know whether the SPEED slider is connected either directly (the output is connected directly to the ghPython component) or indirectly (the wires pass through several down stream components before reaching the ghPython component) to a particular ghPython component.

I have written some code in the ghPython component which recursively finds whether it is connected directly or indirectly to a SPEED slider. (See it attached)

Unfortunately, even if the ghPython component knows which SPEED sliders that it is indirectly connected to. As far as I know there is no way for me to pass this information back to the SPEED slider component as the SPEED slider component is already a compiled dll.

Is there something that I am missing here, how else could I go about this problem?

Views: 340

Attachments:

Replies to This Discussion

I have done someting that using py to modify slider.

But if you want to use slider to pass data to py component,you can write some code inside your GHNumberSlider or read GHNumberSlider data using py component.

Attachments:

Hi Anton

when doing this sort of stuff, you need to be careful and aware of two things:

- the order in which Grasshopper solves components: from left to right, but expiration happens recursively. When a downstream component solves, the upstream ones are already solved.

- you are not allowed to change the state of the solution, or you risk to jeopardize the results. There are some subtle changes possible, like expiring from within a solution, but they are really rather exception more than possible correct ways to approach modification of components.

If you explain the problem with the compiled dll, 

there is no way for me to pass this information back to the SPEED slider component as the SPEED slider component is already a compiled dll.

and what you are trying to do, maybe there are some possible ways.

Thanks

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service