5 Replies Latest reply on Jan 30, 2018 7:27 AM by Elmar Klammer

    I need to put balloons on picture loaded by drawing, but there is no entities for leaders to attach, what should i do?

    Wenjian Li

      I need to set the position of the leader's arrow of an annotation !

      my solution is to create a point entities at the right coordinate, then attach the leaders of annotations to this point, lastly i select the point and delete it.

      but problem come from this, i can't save the drawing. Here is the situation:

      i put  annotations and their leaders on specific coordinates, then i save the drawing ,when i reopen the drawing, it become that shit

      please help me , any thoughts would be nice!!!

      微信图片_20180109165637.jpg微信图片_20180109165709.jpg

        • Re: I need to put balloons on picture loaded by drawing, but there is no entities for leaders to attach, what should i do?
          Elmar Klammer

          Hi Wenjian,

           

          Insert an empty view. Activate the view then add your notes in that view. No need to add/delete a point.

          Correction: In SW16-SP5 at least you cannot insert a picture into a empty or predefined view. Well you can, it just doesn't show up. The view boundary even adjust to the size of the picture but no picture shows. Regarding your issue to place a leader note onto paper space in a drawing works just fine. The note doesn't loose its reference since it doesn't have one. Open and closing the drawing maintains the note position. Just activate the leader setting and you can add notes anywhere.

           

           

          Elmar

            • Re: I need to put balloons on picture loaded by drawing, but there is no entities for leaders to attach, what should i do?
              Wenjian Li

              hi Elmar,

              but how can i set the position of notes' leader arrow?

              i can only find the function SetAttachedEntities in the IAnnotations Interface Methods?

              appreciate you reply.

              Wenjian

                • Re: I need to put balloons on picture loaded by drawing, but there is no entities for leaders to attach, what should i do?
                  Elmar Klammer

                  Hi Wenjian,

                   

                  Stefan Berlitz worked on a question like yours. The trick is to set a virtual mouse click at the position you want to add the leader.

                  Below is his explanation. Just google translate the thing...

                   

                  Link: “https://ww3.cad.de/foren/ubb/Forum2/HTML/027072.shtml”

                   

                   

                   

                  wenn ich das bei meinen Versuchen gerade richtig interprtiert habe wird mit SetLeader3 die Pfeilspitze (oder Knubbel) da hin gesetzt, wo du zuletzt was selktiert hast. Es soltle also gehen, wenn du vorher an der richtigen Stelle virtuell hinklickst. Ein aufbereitetes Makro von mir auf einer A3 Zeichnung trifft so jedenfalls die richtige Stell:

                  Code:
                  ' ******************************************************************************
                  ' C:\Users\b082757\AppData\Local\Temp\swx7828\Macro1.swb - macro recorded on 04/09/14 by b082757
                  ' ******************************************************************************
                  Dim swApp As Object

                  Dim Part As Object
                  Dim boolstatus As Boolean
                  Dim longstatus As Long, longwarnings As Long

                  Sub main()

                      Set swApp = Application.SldWorks
                      Set Part = swApp.ActiveDoc
                     
                      boolstatus = Part.Extension.SelectByID2("", "FACE", 0.16, 0.145, 0#, False, 0, Nothing, 0)   
                      Dim myNote As Object
                      Dim myAnnotation As Object
                      Dim myTextFormat As Object
                     
                      Set myNote = Part.InsertNote("test")
                      If Not myNote Is Nothing Then
                         myNote.LockPosition = False
                         myNote.Angle = 0
                         boolstatus = myNote.SetBalloon(0, 0)
                         Set myAnnotation = myNote.GetAnnotation()
                         If Not myAnnotation Is Nothing Then
                            longstatus = myAnnotation.SetLeader3(swLeaderStyle_e.swSTRAIGHT, 1, True, False, False, False)
                            boolstatus = myAnnotation.SetPosition(0.186, 0.173, 0#)
                            boolstatus = myAnnotation.SetTextFormat(0, True, myTextFormat)
                         End If
                      End If
                      Part.ClearSelection2 True
                      Part.WindowRedraw
                  End Sub


                  Zum Verschieben scheint derselbe Trick zu funktionieren, Leader löschen, virtuell Klicken, Leader erzeugen.

                  Elegantere Methoden hab ich jetzt aber nicht auf Lager 

                  Ciao,
                  Stefan