✨ Eliminate Tedious and Repetitive Tasks by Automatically Creating Macros

How Can AI Virtual Companions Help Me?

Using SOLIDWORKS macros is a great way to eliminate tedious and repetitive tasks that waste design time. However, creating a macro to execute a series of actions can be daunting for users who have little or no coding experience.

With LEO, the SOLIDWORKS AI Virtual Companion, anyone can automatically write a macro using simple prompts in SOLIDWORKS Design.

 

Prerequisites and Set-Up

AURA and LEO AI Virtual Companions can be accessed directly within SOLIDWORKS Design via the Virtual Companion tab in the task pane.

To access AURA and LEO AI Virtual Companions, you will need access to a recent version of SOLIDWORKS Design and be connected to the 3DEXPERIENCE platform.

  • SOLIDWORKS Design (Named-User License)
  • SOLIDWORKS Design with Cloud Services (Device-Locked License)
    • Have the Collaborative Designer for SOLIDWORKS role granted to you
    • Install the Design with SOLIDWORKS application

Note: Version 2026 SP3.2 or later is required to use the AI Virtual Companions in SOLIDWORKS Design

Installation guidance can be found in the Install Your Roles and Applications section of the Getting Started Guide.

<i>Note: Users do not need to save any of their files to the 3DEXPERIENCE platform to use AURA or LEO.</i>

 

How To

1. From the Virtual Companions tab in the SOLIDWORKS Task Pane, select LEO and type a prompt in the Start Writing Area.

Example: "Generate a macro to export every part file in the active assembly as a STEP file". 

 

2. When LEO has finished creating the macro, it will open the Visual Basic for Applications (VBA) editor and display your finished macro. VBA is the engine that records, runs, or edits macros, and is embedded in SOLIDWORKS Design. 

Note: The VBA editor can be used to edit the macro manually if required. 

 

3. To run the macro, select the Run icon in the VBA window. In this example, the LEO has designed the macro to prompt the user to choose which folder to save the STEP files to.

4. LEO can also assist with editing the macro. Just type a description of the changes that are needed in the current LEO conversation, and LEO will rebuild the macro with your changes. Re-run the updated macro to validate it. 

Example: "Edit the macro to automatically create a folder on the desktop or on the C: drive. Name the folder the same as the original assembly name.". 

 

 

Further modifications can be requested by continuing the conversation with LEO.

There may be times when a requested modification is not possible. This could be due to exceeding a limitation of the macro tools. In this situation, LEO warn the user. 

 

5. Using the VBA editor, you can save your macro. When you are finished, exit the VBA editor via File-> Close and return to SOLIDWORKS.

To learn more about working with macros and the SOLIDWORKS API please refer to the online help or contact your SOLIDWORKS Reseller.

https://help.solidworks.com/2026/english/api/sldworksapiprogguide/Welcome.htm?id=0

Example Macro Creation Prompts

Prompt
Export flat pattern to DXF
Create a 3D Sketch from point data in a CSV file
Export all sheets in the active drawing to a single PDF in the same folder
Save all open documents as PDFs into the same directory they're stored in
Export all drawings in this folder as DXF files
Set drawings view scale to sheet scale
Rename all of the sheets in the active drawing to the name of the model in the views on each sheet
Close all documents except drawings
Save all virtual components in the active assembly to files

 

Explore Related Use Cases

Use Cases and Description

AURA

https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/community/swym:prd:R1132100503382:community:52?content=swym:prd:R1132100503382:wikitree:45Kft_v2RR-Y5YIWMLRQtQUse AURA to provide recommended working practices for using SOLIDWORKS Design.

LEO

Learn how the LEO's Assembly Performance Analysis can provide tips and recommendations on how to improve the performance of your large assemblies

LEO

 

 

 

Use LEO's What's Wrong Analysis to provide deeper insights to understand and learn how to fix failed model features.