Hi @breinkemeyer. Automating drawings can be a large and complicated task. There are often multiple ways to do a lot of the things involved too. I'm not sure exactly how you intend to check if these points are the 'known point' you are looking for, but I included one process that came to mind in the below example. This is an iLogic rule, but since iLogic uses VB.NET and I don't think I'm using any iLogic only snippets of code here, this should work OK in other settings too. I made sure not to use the common 'ThisApplication' or 'ThisDoc' types of keywords, because I know they are iLogic tools. See if this helps you.
Dim oInv As Inventor.Application = GetObject(,"Inventor.Application")
Dim oDDoc As DrawingDocument = oInv.ActiveDocument
oSheet = oDDoc.ActiveSheet
oView = oSheet.DrawingViews.Item(1)
oTG = oInv.TransientGeometry
'the 'known point' locations you are looking for
oKnownPoint1 = oTG.CreatePoint2d(2, 6)
oKnownPoint2 = oTG.CreatePoint2d(2, 8)
Dim oIntent1, oIntent2 As GeometryIntent
For Each oDCurve As DrawingCurve In oView.DrawingCurves
If oDCurve.CurveType = CurveTypeEnum.kLineCurve Or _
oDCurve.CurveType = CurveTypeEnum.kLineSegmentCurve Then
If oDCurve.StartPoint.IsEqualTo(oKnownPoint) Then
oIntent1 = oSheet.CreateGeometryIntent(oDCurve, oDCurve.StartPoint)
ElseIf oDCurve.EndPoint.IsEqualTo(oKnownPoint) Then
oIntent1 = oSheet.CreateGeometryIntent(oDCurve, oDCurve.EndPoint)
ElseIf oDCurve.StartPoint.IsEqualTo(oKnownPoint2) Then
oIntent2 = oSheet.CreateGeometryIntent(oDCurve, oDCurve.StartPoint)
ElseIf oDCurve.EndPoint.IsEqualTo(oKnownPoint2) Then
oIntent2 = oSheet.CreateGeometryIntent(oDCurve, oDCurve.EndPoint)
End If
End If
Next
If Not IsNothing(oIntent1) And Not IsNothing(oIntent2) Then
oTextPoint = oTG.CreatePoint2d(1.5, 7)
oGenDims = oSheet.DrawingDimensions.GeneralDimensions
oDim1 = oGenDims.AddLinear(oTextPoint, oIntent1, oIntent2, DimensionTypeEnum.kVerticalDimensionType)
End If
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡 or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)