Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Find area excluding interior faces

2 REPLIES 2
Reply
Message 1 of 3
wood.isbell
479 Views, 2 Replies

Find area excluding interior faces

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.

2 REPLIES 2
Message 2 of 3
humbertogo
in reply to: wood.isbell

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

Message 3 of 3
wood.isbell
in reply to: humbertogo

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report