Hello @davidt162003,
Uhm I didn't go through all of your code. Just to clarify few things here is a sample code of mine that will create a balloon on the specified edge. The structure will be : a drawing view of a part that is placed inside an assembly.
1. I would create a nozzle part with an attribute on an edge to look for later on :
Dim e As Inventor.Edge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeFilter, "Pick an edge")
Dim ast As Inventor.AttributeSet = e.AttributeSets.Add("newSet")
ast.Add("newAtt", ValueTypeEnum.kStringType, "target")
2. On the drawing sheet I would get the desired view,
3. Loops through all the curves,
4. Skip if the curve is not made from an edge. Note that we are looking for edges proxies since we are working with assembly documents.
5. For each edge proxy we find, get the native edge,
6. Look for the attribute inside the native edge's attributes set,
7. If we have a match, get the current curve inside an object,
8. Exit the iteration,
9. Create a geometry intent of the curve,
10. bla bla bla,
Sample code to demonstrate :
Dim doc As Inventor.DrawingDocument = ThisApplication.ActiveDocument
Dim s As Inventor.Sheet = doc.ActiveSheet
Dim nozzleView As Inventor.DrawingView = s.DrawingViews.Item(1)
Dim targetCurve As Inventor.DrawingCurve = Nothing
For Each c As Inventor.DrawingCurve In nozzleView.DrawingCurves
If c.ModelGeometry.type <> ObjectTypeEnum.kEdgeProxyObject Then Continue For
Dim e As Inventor.EdgeProxy = c.ModelGeometry
Dim nativeE As Inventor.Edge = e.NativeObject
If nativeE.AttributeSets.NameIsUsed("newSet") = True Then
targetCurve = c
Exit For
End If
Next
If targetCurve Is Nothing Then
MsgBox("Could not find target")
Exit Sub
End If
Dim curveIntent As Inventor.GeometryIntent = s.CreateGeometryIntent(targetCurve)
Dim points As Inventor.ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
points.Add(ThisApplication.TransientGeometry.CreatePoint2d(targetCurve.CenterPoint.X - 5 , targetCurve.CenterPoint.Y + 1 ))
points.Add(curveIntent)
Dim newBaloon As Inventor.Balloon = s.Balloons.Add(points)
Result :

I would probably have a look at this : Inventor 2023 Help | Balloons.Add Method | Autodesk
Especialy for the points you have to reference.
And maybe this whould also be useful : Inventor 2023 Help | Proxies | Autodesk
I attached sample files for the demo.
Kind regards,
FINET L.
If this post solved your question, please kindly mark it as "Solution"
If this post helped out in any way to solve your question, please drop a "Like"@LinkedIn @JohnCockerill