Typically, a feature is created from a profile. Assume we have got the feature, the Feature.Profile can return a set of connected curves (ProfilePath) used as input for a feature., ProfilePath.TextBoxPath tells if the profile is a TextBox, and ProfilePath.TextBox will return the TextBox object. The following is a code demo.
Private Sub Test()
Try
oApp =
System.Runtime.InteropServices.Marshal.
GetActiveObject("Inventor.Application")
'assume a feature is selected
Dim extFeature As ExtrudeFeature
extFeature =
oApp.ActiveDocument.SelectSet(1)
Dim path As ProfilePath
For Each path In extFeature.Profile
If path.TextBoxPath Then
' if the profile is a textbox
'get the textbox object
Dim oTB As TextBox = path.TextBox
Else
' if it is from other sketch entities.
If path.Count > 0 Then
For Each entity As
Inventor.ProfileEntity In path
'iterate each sketch entity in the path
If entity.CurveType =
Curve2dTypeEnum.kLineSegmentCurve2d Then
'if it is a sketch line.
Dim oSkE As SketchEntity =
entity.SketchEntity
Dim oLine As SketchLine =
CType(oSkE, SketchLine)
Dim startpt As Inventor.Point2d =
oLine.StartSketchPoint.Geometry
Dim endpt As Inventor.Point2d =
oLine.EndSketchPoint.Geometry
End If
''other sketch types
''
Next
End If
End If
Next
Catch ex As Exception
End Try
End Sub