Message 1 of 3
Placing Leader notes on a drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello there.
1) I am trying to automate placing a leader note in a drawing sheet (idw) I copied this from Inventor's helpful API but I need guidance on how to tweak it to suit my environment.
It is just one view, the note should point to a horizontal line and there is more than one leader note required.
2) The final outcome is to place the notes in Excel which places the leader note in the idw environment at specific points on the part.
Is this achievable?
Many Thanks
Emilda
Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.ActiveDocument.Add("C:\Working_Directory_File\iLogic\STANDARD DWG",True) Dim oActiveSheet As Sheet oActiveSheet = oDrawDoc.ActiveSheet Dim oDrawingCurveSegment As DrawingCurveSegment oDrawingCurveSegment = oDrawDoc.SelectSet.Item(1) Dim oDrawingCurve As DrawingCurve oDrawingCurve = oDrawingCurveSegment.Parent Dim oMidPoint As Point2d oMidPoint = oDrawingCurve.MidPoint Dim oTG As TransientGeometry oTG = ThisApplication.TransientGeometry Dim oLeaderPoints As ObjectCollection oLeaderPoints = ThisApplication.TransientObjects.CreateObjectCollection oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 10, oMidPoint.Y + 10)) oLeaderPoints.Add(oTG.CreatePoint2d(oMidPoint.X + 10, oMidPoint.Y + 5)) oGeometryIntent As GeometryIntent oGeometryIntent = oActiveSheet.CreateGeometryIntent(oDrawingCurve) oLeaderPoints.Add(oGeometryIntent) Dim sText As String sText = "API Leader Note" Dim oLeaderNote As LeaderNote oLeaderNote = oActiveSheet.DrawingNotes.LeaderNotes.Add(oLeaderPoints, sText) Dim oFirstNode As LeaderNode oFirstNode = oLeaderNote.Leader.RootNode.ChildNodes.Item(1) Dim oSecondNode As LeaderNode oSecondNode = oFirstNode.ChildNodes.Item(1) Call oFirstNode.InsertNode(oSecondNode, oTG.CreatePoint2d(oMidPoint.X + 5, oMidPoint.Y + 5)) End Sub