Hide Table of Contents

Record SolidWorks Macro

To record a SolidWorks macro:

  1. Click Record\Pause Macro on the Macro toolbar, or click Tools, Macro, Record.

  2. Perform the actions that you want to record.

  3. When you are done recording, click Stop Macro on the Macro toolbar or click Tools, Macro, Stop.

  4. In the dialog, type a name for the macro in File name, select the type of macro in Save as type, and click Save.

NOTES:

  • If you selected SW VBA Macros (*.swp), then the .swp extension is automatically added to the filename.

  • If you selected SW VSTA VB Macro (*.vbproj), then a Visual Basic .NET project is created. Building or debugging the project creates an executable file with an filename extension of .dll.

  • If you selected SW VSTA C# Macro (*.csproj), then a C# project is created. Building or debugging the project creates an executable file with an filename extension of .dll.

  • If you selected SW All Macros Types (*.swp, *.csproj, *.vbproj), then a VBA macro file is created and VB.NET, and C# projects are created. A .swp extension is automatically added to the VBA macro's filename. Two folders are created for the VB.NET and C# projects.

  • The VB.NET project folder's name is the name of the macro plus -vbnet.

  • The C# project folder name is the name of the project plus -csharp.

    For example, if you saved the just recorded macro as Macro1 and selected SW All Macros Types (*.swp, *.csproj, *.vbproj) in Save as type, then the folder where you saved the macros would contain a file called Macro1.swp and two project folders, Macro1-vbnet and Macro1-csharp. The VB.NET and C# projects reside in their respective folders.

    NOTE
    : The Automatically edit macro after recording system option has no effect when you select to save a just recorded macro as SW All Macros Types (*.swp, *.csproj, *.vbproj).

To pause while recording a macro, click Record\Pause Macro or Tools, Macro, Pause. Click Record\Pause Macro again to continue recording.



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Record SolidWorks Macro
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2010 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.