AnsweredAssumed Answered

User defined insert point of note

Question asked by Fredrik Carlsson on Sep 7, 2010
Latest reply on Sep 8, 2010 by Fredrik Carlsson

I have created a macro that gets the current revision of the drawing and inserts a revision note. Now I would like to edit it so the user can click in the drawing to specify where the note will be inserted. (I would like to replace the row containing "boolstatus = Annotation.SetPosition(0.2, 0.2, 0)") How can I do this?

 

'---------------------------------------------

 

Option Explicit

 

 

 

Sub main()

 

Dim swApp As SldWorks.SldWorks

 

Dim Part As ModelDoc2

 

Dim Annotation As Annotation

 

Dim Note As Note

 

Dim boolstatus As Boolean

 

Dim longstatus As Long

 

 

 

Set swApp = CreateObject("SldWorks.Application")

 

Set Part = swApp.ActiveDoc

 

Set Note = Part.InsertNote(Part.GetCustomInfoValue("", "DOCUMENT._R01_REVISION"))

 

If Not Note Is Nothing Then

 

   Note.Angle = 0
   Note.SetHeightInPoints (10)

 

   boolstatus = Note.SetBalloon(2, 0)

 

   Set Annotation = Note.GetAnnotation()

 

   If Not Annotation Is Nothing Then

 

      longstatus = Annotation.SetLeader2(False, 0, True, True, False, False)

 

      boolstatus = Annotation.SetPosition(0.2, 0.2, 0)

 

   End If

 

End If

 

Part.ClearSelection2 True

 

Part.WindowRedraw

 

 

End Sub

Outcomes