Grasshopper

algorithmic modeling for Rhino

Script component catching change events in embedded clusters ...

Hello everyone,

We have a c# script that has no inputs, but is used to recursively iterate through:

- the components in the document

- the linked clusters

- the components in the linked clusters

- and so on

The c# script then collects error messages from each of these components and displays them centrally. The component initially works ok, but is not refreshed correctly. I've tried to hook into the following events, with no success:

- SolutionEndEventHandler

- SolutionEnd

- ModifiedChanged

- ContextChanged

Is there an event I can hook into and force a refresh of the messages collected by the script?

Thanks for your help.

Milan

Views: 712

Replies to This Discussion

Thanks Tom for the quick feedback. I'm gonna a play a little, see if it works in my environment/codebase.

1.If you just want get runtime messages in base document,you can do as Tom's.

2.If you want get messages of components in the clusters,you should handle in the cluster because there is no way get the components inside the cluster in the base document.I put an example,you can take as a reference!

Attachments:

What I'm doing now is iterating through all the objects in document.

If I encounter an object that is a cluster, then I check the cluster.Document("").Objects array and continue navigating.

So recursively navigating the document/cluster tree its possible to retrieve all the embedded objects.

At each stage I collect messages in the script component that fired the event off.

My problem is that the script has no input parameters, so it is not recalculated in normal circumstances. I want to fix this problem elegantly. Doing so using a separate thread is a bit yucky, is that the only way? No other hooks into forcing the script to rerun?

@Tom, can I expire solution on the script?

@Panda, would like to see what you do in your password protected embedded cluster definition. Can you elaborate?

I 'll give the definition later!

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service