use AlignHorz
follow code don't align many note
Private Sub del()
Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2
Set SwApp = Application.SldWorks
Set SwModel = SwApp.ActiveDoc
Dim SwDraw As DrawingDoc
Set SwDraw = SwModel
Stop
SwDraw.AlignHorz
End Sub
Hi Ning,
Please try the below code to align the left of selected annotations.
Dim swApp As SldWorks.SldWorks
Dim swmodel As SldWorks.ModelDoc2
Dim swdraw As SldWorks.DrawingDoc
Dim boolstatus As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc
Set swdraw = swmodel
'Selecting the Annotations
boolstatus = swmodel.Extension.SelectByID2("DetailItem414@Drawing View1", "NOTE", 0.30421635550002, 0.549356344075223, 0, True, 0, Nothing, 0)
boolstatus = swmodel.Extension.SelectByID2("DetailItem416@Drawing View1", "NOTE", 0.321497407017431, 0.517398235104668, 0, True, 0, Nothing, 0)
boolstatus = swmodel.Extension.SelectByID2("DetailItem417@Drawing View1", "NOTE", 0.321497407017431, 0.490411387529533, 0, True, 0, Nothing, 0)
boolstatus = swmodel.Extension.SelectByID2("DetailItem415@Drawing View1", "NOTE", 0.278886595056691, 0.456559464694056, 0, True, 0, Nothing, 0)
swmodel.Extension.RunCommand swCommands_AnnotationAlignLeft, "Align to left"
End Sub
Manikandan