Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an elliptical cone rotated in two planes that is cut with a cylinder in an assembly document. What I would like to do is programmatically (iLogic, VBA, or VB.net) get the surface area of the face after the cut. I was able to get surface areas from part documents using the code (iLogic) below, but I am unable to get it working in an assembly document. Can you help?
Dim oDoc As PartDocument = ThisDoc.Document
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim st As String =""
For Each oSurfBody As SurfaceBody In oDef.SurfaceBodies
st &= vbNewLine & oSurfBody.Name & vbNewLine
Dim volume As Double = oSurfBody.Volume(0.00001)
st &= "volime = " & volume & vbNewLine
Dim area As Double = 0.0
For Each oFace As Face In oSurfBody.Faces
Dim oEval As SurfaceEvaluator = oFace.Evaluator
area = area + oEval.Area
Next
st &= "area = " & area & vbNewLine
Next
Beep
MsgBox(st)
Solved! Go to Solution.
