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: 

Depth of Extrude Feature

1 REPLY 1
SOLVED
Reply
Message 1 of 2
thomaskennedy
346 Views, 1 Reply

Depth of Extrude Feature

I want to query the depth of an extrude feature in a model from a drawing file - I've got access to the feature from the drawing file, but I'm struggling to find the correct method to query the extrude depth.

 

I can see I can get Faces / StartFaces / EndFaces from which I could do some evalution on - however, StartFaces.Count is 0 (not sure why) EndFaces.Count is 1 (seems logical) and Faces.Count is 9 on a simple ractangular extrusion of depth 10mm.

 

In reality the extrusion could be any shape, any depth and either a set depth or through all.

 

Am I on the right tracks with evaluating the Faces collections? Or is there an easier way to get the depth ?

 

Thanks

Tom

1 REPLY 1
Message 2 of 2

Here's what I've got to work for me (the depth of the extrude is always in the Y direction in my case). I added the min / max of each face to a list, sorted it and took the first item as the minimum and the last item as the maximum from which I can calculate the depth.

 

I used Abs() to convert from a negative into a positive number.

 

    Dim ALLface As Faces = feat.Faces

Dim oFaceListMin As List(Of Double) = New List(Of Double)
Dim oFaceListMax As List(Of Double) = New List(Of Double)

For Each oFace In ALLface
oFaceListMin.Add(oFace.Evaluator.RangeBox.MinPoint.Y)
oFaceListMax.Add(oFace.Evaluator.RangeBox.MaxPoint.Y)
Next

oFaceListMin.Sort()
oFaceListMax.Sort()

Dim oFaceList As List(Of Double)
oFaceList = New List(Of Double)

oFaceList.Add(oFaceListMin.Item(0))
oFaceList.Add(oFaceListMax.Item(oFaceListMax.Count - 1))

oFaceList.Sort()

Dim extrudedepth As Double = (oFaceList.Item(0) - oFaceList.Item(oFaceList.Count - 1)) * 10

 

Tom

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

Post to forums  

Autodesk Design & Make Report