How to measure the length of a flange with API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How could I measure the length of a flange with the API.
I thought there would just be a simple FlangeDefinition.WidthExtent.Value
My rule goes something like this (its in VBA but open to iLogic aswel), maybe I'm going about it the wrong way?
Sub Main()
' Get active document
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
' Make sure the active document is a sheet metal document.
If oPartDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
MsgBox ("A sheet metal document must be open.")
Exit Sub
End If
' Get component definition of part
Dim oCompDef As SheetMetalComponentDefinition
Set oCompDef = oPartDoc.ComponentDefinition
' Get the referenced document feature collection
Dim oFlangesFeatures As PartFeatures
Set oFlangeFeatures = oCompDef.Features.FlangeFeatures
Dim oFlange As FlangeFeature
For Each oFlange In oFlangeFeatures
Call oFlange.SetEndOfPart(True)
Dim oDef As FlangeDefinition
Set oDef = oFlange.Definition
Dim oEdge As Edge
For Each oEdge In oDef.Edges
Dim oExtent As PartFeatureExtent
Set oExtent = oDef.GetWidthExtent(oEdge)
Dim oWidth As Double
' How do I get width !!! ?????
Next
Next
End Sub