Macro to Change Balloon Formating on all sheetsI

I have a small recorded macro that changes the formatting of balloons. 3 place with item number.

Is there a way to run it on all sheets?

SolidworksApi macros
Answers 3
DG
DG 2017-03-24 Best Answer

SW API Help files are your friend : Get Sheet Numbers and Names Example (VBA)

CA
CA 2017-03-24

Thanks Deepak,

I had seen this, i am ok with running VB in single cases. i seem to lack in the multiples... Running code on multiple items has always given me a headache.

DG
DG 2017-03-24
<p>Option Explicit</p><p></p><p>Dim swApp As SldWorks.SldWorks</p><p>Dim swModel As SldWorks.ModelDoc2</p><p>Dim swDraw As SldWorks.DrawingDoc</p><p>Dim vSheetName As Variant</p><p>Dim i As Integer</p><p>Dim bRet As Boolean</p><p></p><p>Sub main()</p><p></p><p>Set swApp = Application.SldWorks</p><p>Set swModel = swApp.ActiveDoc</p><p>Set swDraw = swModel</p><p></p><p>' Get the sheets in the drawing document</p><p>vSheetName = swDraw.GetSheetNames</p><p></p><p>' Traverse the drawing sheets </p><p>For i = 0 To UBound(vSheetName)</p><p>   bRet = swDraw.ActivateSheet(vSheetName(i))</p><p>' Your balloon codes here  </p><p>Next i</p><p></p><p>End Sub</p>