0 Replies Latest reply on Jul 9, 2014 7:16 AM by Manikandan Babu

    How to align the overlap notes

    Manikandan Babu

      Dear team,

       

                   i wrote a macro for automatic configuration name update for everycomponent in a  single assembly drawing view.in that i could not align the notes near by every component in a single view.notes are get overlap.please help me to resolve this,for your reference

       

                  

      Option Explicit

      Dim swApp As SldWorks.SldWorks

      Dim swModel As SldWorks.ModelDoc2

      Dim SWDRAW As SldWorks.DrawingDoc

      Dim swSelMgr As SldWorks.SelectionMgr

      Dim swdrawcomp As SldWorks.DrawingComponent

      Dim swcomp As SldWorks.Component2

      Dim swmodel2 As SldWorks.ModelDoc2

      Dim swconfig As SldWorks.Configuration

      Dim swconfigname As String

      Dim count As Long

      Dim seltype As Long

      Dim SWANN As SldWorks.Annotation

      Dim myNOTE As SldWorks.NOTE

      Dim i As Integer

      Dim bret As Boolean

      Sub main()

      Set swApp = Application.SldWorks

      Set swModel = swApp.ActiveDoc

      Set SWDRAW = swModel

      Set swSelMgr = swModel.SelectionManager

      count = swSelMgr.GetSelectedObjectCount

      For i = 0 To count

      seltype = swSelMgr.GetSelectedObjectType3(i, -1)

      If swSelFACES = seltype Then

      Set swdrawcomp = swSelMgr.GetSelectedObjectsComponent2(i)

      Set swcomp = swdrawcomp.Component

      Set swmodel2 = swcomp.GetModelDoc2

      Set swconfig = swmodel2.GetActiveConfiguration

      swconfigname = swconfig.Name

      Set myNOTE = swModel.InsertNote(swconfigname)

      Set SWANN = myNOTE.GetAnnotation

      SWANN.SetLeader3 swNO_LEADER, swLS_SMART, False, False, False, False

      End If

      Next

      End Sub