I am trying to calculate the area of a frame. Most of the frame is made of tubes, and I only want the exposed surfaces for the purpose of calculating powder coat area. The Area property in the API calculates entire surface area, so I end up with all of the faces, even those which are sealed.
Can anyone help me come up with a way to remove the faces which are not exposed or remove all interior faces of a tube. The first would give me the interior of down-facing tubes which will be filled later and do not need powder coat, and the second would give me surfaces between tubes which cannot be powder coated. Either method would be close enough for what I need, but a mixture of the two would be the best case.
Maybe this help to start
The sample below illustrates a program that checks to see if a single has been selected and displays its surface area.
Public Sub ShowSurfaceArea()
' Set a reference to the select set of the active document.
Dim oSelectSet As SelectSet
Set oSelectSet = ThisApplication.ActiveDocument.SelectSet
' Check to make sure a single item was selected.
If oSelectSet.Count = 1 Then
' Check to make sure a face was selected.
If TypeOf oSelectSet.Item(1) Is Face Then
' Set a reference to the selected face.
Dim oFace As Face
Set oFace = oSelectSet.Item(1)
' Display the area of the selected face.
MsgBox "Surface area: " & oFace.Evaluator.Area & " cm^2"
Exit Sub
Else
MsgBox "You must select a single face."
Exit Sub
End If
Else
MsgBox "You must select a single face."
Exit Sub
End If
End Sub
Thank you for the reply, humberto. This would help me to get the area of the faces, and I can cycle through all of the faces in the assembly, but the resulting area would be the same as the MassProperties.Area() property. I need to limit the faces to those described in some way, but I have not yet thought of a way to determine if a face is closed or blocked by another (i.e. two parts directly adjacent) or if a face is inside the geometry of its parent part (i.e. a tube).
I suspect that the API doesn't have anything to differentiate these faces (or partial faces) based on any of these criteria, but it may also be that I just haven't gotten creative enough.