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
Solved! Go to Solution.
Solved by thomaskennedy. Go to Solution.
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