Grasshopper

algorithmic modeling for Rhino

Hi

Look at this piece of code

For Count = 0 To BrepForBools.Count - 1

BrepForBoolTemp = BrepForBools(Count)
BrepForBoolsFinal.Add(BrepForBoolTemp)
Dim FBO() As Brep = Brep.CreateBooleanDifference(BrepForBoolsFinal, BrepToBools, tolerance)
TempToBool = FBO(0)
BrepToBools.Clear
BrepToBools.Add(TempToBool)

' Erase FBO

Next

 

I'm trying to update one of the boolean operation's argument with the result of the previous iteration, but as it is, during the second iteration I get a NullReferenceException.

I think I need to build a different istance of the object FBO in every iteration... ???

I try to erase FBO but it doesn't works.

Hints are welcome.

Thanks

Paolo

Views: 282

Replies to This Discussion

Ok, I make a mistake, this is the right piece of code for create a recursive boolean operation with a for loop

 

For Count = 0 To BrepForBools.Count - 1
BrepForBoolTemp = BrepForBools(Count)
BrepForBoolsFinal.Add(BrepForBoolTemp)
FBO = Brep.CreateBooleanDifference(BrepForBoolsFinal, BrepToBools, tolerance)
TempToBool = FBO(0)
BrepForBoolsFinal.Clear
BrepToBools.Clear
BrepToBools.Add(TempToBool.DuplicateBrep)
Next

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service