1 Reply Latest reply on Jul 8, 2014 2:24 AM by Manikandan Babu

    how to get components position in a single view

    Manikandan Babu

      i have to position a notes for all component in a assembly view

        • Re: how to get components position in a single view
          Manikandan Babu

          all notes are located in same place & overlap

           

           

           

          Dim swApp As SldWorks.SldWorks

          Dim swmodel As SldWorks.ModelDoc2

          Dim swCompModel As SldWorks.ModelDoc2

          Dim swdraw As SldWorks.DrawingDoc

          Dim swsel As SldWorks.SelectionMgr

          Dim swRootDrawComp As SldWorks.DrawingComponent

          Dim swview As SldWorks.View

          Dim swDrawComp  As SldWorks.DrawingComponent

          Dim vDrawChildCompArr As Variant

          Dim SWCOMP As SldWorks.Component2

          Dim i As Integer

          Sub main()

          Set swApp = Application.SldWorks

          Set swmodel = swApp.ActiveDoc

          Set swdraw = swmodel

          Set swsel = swmodel.SelectionManager

          Set swview = swsel.GetSelectedObjectsDrawingView(1)

          Set swRootDrawComp = swview.RootDrawingComponent

          vDrawChildCompArr = swRootDrawComp.GetChildren

          For i = 0 To UBound(vDrawChildCompArr)

          Set swDrawComp = vDrawChildCompArr(i)

          Set SWCOMP = swDrawComp.Component

          Set swCompModel = SWCOMP.GetModelDoc2

          Dim CONFIG As SldWorks.Configuration

          Set CONFIG = swCompModel.GetActiveConfiguration

          swdraw.InsertNewNote CONFIG.Name, False, False, False, 0, 0

          Next

          End Sub