Message 1 of 21
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to set the origin indicator on a drawing view in an IDW file. The rule i wrote below works if the two lines actually intersect. The issue is when the lines come to a radius instead of a vertex. Is there a way to get the theoretical intersection? Alternatively could I get the x value of one line, the y value of the other, and combine them to a point that I can set the origin to? Any advice or help would be greatly appreciated, also open to any suggestions if there is a better way to set the origin indicator from the drawing view.
Sub Main()
'Get the active sheet
Dim oSheet As Sheet = ThisApplication.ActiveDocument.ActiveSheet
'Get the curves for intersection point
Dim oCurve1 As DrawingCurve = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick first intersection curve").Parent
Dim oCurve2 As DrawingCurve = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Pick second intersection curve").Parent
'Create GeometryIntent for intersection
Dim oIntersectionIntent As GeometryIntent = oSheet.CreateGeometryIntent(oCurve1, oCurve2)
Dim oDrawingView As DrawingView = oCurve1.Parent
'If origin indicator has Not been already created, create it first.
If Not oDrawingView.HasOriginIndicator Then
MsgBox("no origin indicator")
oDrawingView.CreateOriginIndicator(oIntersectionIntent)
Else
MsgBox("has origin indicator")
oDrawingView.OriginIndicator.Intent = oIntersectionIntent
End If
End Sub
Solved! Go to Solution.