CAD+ Toolset | Utilities for SOLIDWORKS automation
SOLIDWORKS utilities for improving your productivity in SOLIDWORKS. Automate properties, geometry, export and much more

Download Buy

Managing VBA macro arguments in CAD+


Passing parameters to the macro

Coming soon...

Retrieving parameters in the macro

When parameters are passed to the macro via Toolbar+, Batch+ or from custom invocation, macro can retrieve them by accessing the CadPlus.MacroRunner.Sw::PopParameter method.

Call ::Get method to get specific parameter by name.

Dim macroRunner As Object
Set macroRunner = CreateObject("CadPlus.MacroRunner.Sw")

Dim param As Object
Set param = macroRunner.PopParameter(swApp)
    
Dim vArgs As Variant
vArgs = param.Get("Args")

Dim text As String
text = param.Get("Text")

Dim swModel As SldWorks.ModelDoc2
Set swModel = param.Get("Model")

Setting result

Coming soon...


Powered by Docify