Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have created a file that has a pair of bodies being split by a workplane that is offset with the parameter "Dig_Depth" and would like to create a report that shows the volume of each body at each Dig Depth.
However, my code just reports a single set of numbers over and over again;
| 0 | 231709.2 | 5.23E+08 |
| 1 | 231709.2 | 5.23E+08 |
| 2 | 231709.2 | 5.23E+08 |
The numbers are what the model shows before running the rule.
How can I get my code to update the Volumes?
My code;
oCSVfile = System.IO.File.CreateText(ThisDoc.PathAndFileName(False) & ".csv")
Dim doc As PartDocument= ThisDoc.Document
Dim oCD As ComponentDefinition = doc.ComponentDefinition
Dig_Depth = 0
For Dig_Depth = 0 To 2
oCSVfile.WriteLine(Dig_Depth & "," & oCD.SurfaceBodies(1).Volume(0.01) & "," & oCD.SurfaceBodies(2).Volume(0.01))
Next Dig_Depth
oCSVfile.Close()
Solved! Go to Solution.