MACRO LIBRARY

Run macro from Design Binder

Free public access. No account or subscription required.

Files

RunAttachedMacro.swp AttachedMacro.swp

RunAttachedMacro.swp Code

Module: mMain

'Demonstrates how to run a macro in the Design Binder.
    
'Preconditions: AttachedMacro.swp was added to the Design Binder of active document
'Results: message stating that ISldWorks::RunAttachedMacro succeeded is displayed
    
'Written by Keith Rice
'CADSharp LLC
'www.cadsharp.com
    
Dim swApp As SldWorks.SldWorks
    
Sub main()
    Set swApp = Application.SldWorks
    swApp.RunAttachedMacro "AttachedMacro.swp", "mMain", "main"
End Sub
    
'Notes
'   To add the macro to the design binder, go to Tools-->Options-->System Options tab, _
    FeatureManager category, Hide/Show Tree Items, and set Design Binder to Show. Then _
    right click on Design Binder in the FM tree, choose Add, browse for AttachedMacro.swp

AttachedMacro.swp Code

Module: mMain

'Used in conjunction with RunAttachedMacro.swp to demonstrate running a macro from the _
    Design Binder. See comments in RunAttachedMacro.swp for details.
    
Dim swApp As SldWorks.SldWorks
    
Sub main()
    Set swApp = Application.SldWorks
    swApp.SendMsgToUser "ISldWorks::RunAttachedMacro succeeded."
End Sub