Grasshopper

algorithmic modeling for Rhino

Hi David,

I've seem to run into a weird error. The disable/enable solver lock button doesn't seem to be working. Even with the solution lock on, the "rebuild solution" button is still functional.

 

More oddly, when looking at custom component that output a set of values, when I hit rebuild solution, the new set of results gets stacked below the existing set. Somehow, values from previous runs are not getting cleared in the fresh rebuild.

 

For example, if my list produces a set of 5 values and I hit rebuild, I then get a list of 10 values and so on.

 

Shouldn't all variables, lists etc get cleared upon each "rebuild solution"?

 

Thanks.

Kermin

Views: 6495

Replies to This Discussion

Hi Kermin,

 

"Even with the solution lock on, the 'rebuild solution' button is still functional."

 

that's supposed to work this way. It didn't use to, but people requested that the Button would circumvent the Solver Lock. And I agree, if someone goes through the trouble to actually press the button, chances are they really want to rerun the solution.

 

However, it shouldn't happen under any other circumstances. The Solver Lock is a single global bool in Grasshopper which can get set/unset by any code that runs inside Grasshopper. Though I sincerely doubt any 3rd party programmer is accessing it.

 

"Somehow, values from previous runs are not getting cleared in the fresh rebuild."

 

There's two ways to run solutions, when you use the Rebuild button Grasshopper should erase all data, then recalculate. If you make a change to an individual object in the network (say you drag a slider value) then only the data that potentially depends on the slider is cleared. I.e. the slider itself, any objects which are connected to the slider via a wire, any objects which are connected to those objects and so on and so forth. After this wave of data wiping has subsided, a new 'light' solution starts, and it only recalculates those bits which have expired.

 

So if you use the Rebuild button and your data is not cleared, there's a bug somewhere. You mentioned this is a custom component, can you upload the code or email it to me personally?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi all,

My custom components are suddenly not clearing between solver rebuilds. The component seems to keep all output and variable values from previous builds and just stacks the new solution results onto the previous solutions. The image below is what results.

While this image below looks kind of cool, it's complete anarchy for any sort of real work now.

 

I've tried uninstalling and re-installing Rhino and grasshopper but that didn't help.

 

Any ideas, suggestions to how this can be fixed are welcome. 

 

Thanks.

 

Kermin

 

I'll need to see the code of your custom components. Are you perchance overriding functions like: ExpireDownStreamObjects(), ClearData(), CollectData() or ComputeData()?

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David,

No fancy overriding functions for me.

 

I tried stepping through the code using the RHino 5 debug today and found that the variables holding the incoming datalists (numbers, geometry etc) were not clearing at each rebuild. 

I was finding that if I send in 10 lines to "Riblist", on the first instance it reports holding 10 items. Upon the rebuild, without the explicit Riblist.Clear(), it reported holding 20 items.

 

I included an explicit xxx.clear() before I call DA.GetDataList and that fixed it (for now at least). For example:

 

RibList.Clear()

SubDivision = 1


If Not (DA.GetDataList(0, RibList)) Then Return     

If Not (DA.GetData(1, SubDivision)) Then Return

DA.GetData(2, ClosedDiagrid_bool)

 

In this component, I had declared the variables after the "Inherits GH_Component" as private. Example:

 

Inherits GH_Component
Private RibList As New List(Of Curve)

Private SubDivision As Integer = 1

Private ClosedDiagrid_bool As Boolean = False

 

 

Might this be messing things up since upon a rebuild of the solution, the class is not getting reinstantiated but just the "solve instance" sub routine is run?

 

Oddly, this was messing up any other custom component without the grasshopper file.

 

Hope this make some sort of sense. 

 

Thanks.

 

Kermin

 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service