Grasshopper

algorithmic modeling for Rhino

Hi All,

I try to create a component, that reads a text file and returns a single value. Ok, it's simple and it works. Now, I am changing the text file and my component updates its output and all objects downstream will recompute, don't care if the value has changed or not.

So I would like to control, if the objects downstream recompute or not.

 If update Then
    DA.SetDataList(0, value)
Else

    '--> Set Outputs without forcing downstream objects to recompute

End If

Does anybody has an idea?

Thanks.

Toben

Views: 546

Replies to This Discussion

Hi Toben,

it's too late! By the time SolveInstance is called downstream components have already been expired. Who's doing the checking to see if the file changed?

--

David Rutten

david@mcneel.com

Seattle, WA

Hi David,

the check happens inside my component. I added the component class and a grasshopper file which shows my plan (hopefully)

Can I overwrite the function that calls SolveInstance? Maybe I could implement my check there and trigger SolveInstance?

Thanks a lot

Toben

Attachments:

I don't think you can do it. You're in the middle of a process which upstream gets data from a file. When that component decides that it should expire, it will expire your component and you will in turn expire all your descendants. You'd have to find a way to figure out right there and then that expiration is not needed, however you do not have the information available to make that decision.

Since your input is a Text parameter rather than a File parameter, you're really not in a position to affect the outcome.

--

David Rutten

david@mcneel.com

Seattle, WA

Thanks David,

so I guess I have to look for another way. Maybe without cables.

Regards

Toben

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service