VSTA 2022 Integration

Along with the integration of VSTA 2022, you need to install Visual Studio 2022 to edit VSTA macros.

VSTA 2022 relies on any supported .NET Framework. It contains a new version of the Common Language Runtime allowing VSTA 2022 projects, including upgraded projects, to run faster than VSTA 2.0 projects.

This page discusses:

Visual Studio

Visual Studio replaces the VSTA integrated development environment (IDE) that allows to edit VSTA macros.

With VSTA 2.0, you edited VSTA macros into an integrated Visual Studio 2008 based environment. Starting from VSTA 2012, VSTA does not provide its own Visual Studio based environment. With VSTA 2022, you need to acquire and install Visual Studio 2022 to edit VSTA macros. Otherwise, you are only able to run VSTA macros.

Multiple projects in a single session

With VSTA 2.0, you could load only one VSTA project at a time in the editor and you had to select the active macro library from the Macros dialog box.

With VSTA 2022, once a VSTA macro library opens in the 3DEXPERIENCE platform, the VSTA project loads in Visual Studio. You can open multiple projects simultaneously and switch from one project to another without leaving Visual Studio.

Note: Macro libraries that have been duplicated (explicit duplication or duplication through PLM versioning) cannot be opened simultaneously in the macros GUI because it would result in a name conflict and an ID conflict.

Debug Behavior

Debugging occurs exclusively from Visual Studio:

  • Each project has a unique static entry point for debugging, CATMain.
  • In Visual Studio, you can press F5 to start debugging. Since you can open multiple projects simultaneously, to select the active project, right-click the project and select Set as StartUp Project in the Solution Explorer.

You cannot debug any entry point beginning with the string "Macro". You need to call the function to debug inside the CATMain method.

Save Behavior

Potential pending modifications remain in memory if a macro library opens. When closing Visual Studio, if you do not save the project when prompted, you do not lose pending modifications until you close the macro library. You can then reopen Visual Studio to continue editing the project.

Warning: Close Visual Studio before closing the 3DEXPERIENCE platform. Otherwise, you are not prompted to save your changes. Any unsaved changes are lost.

Selecting a macro library in the Macro libraries dialog box or reopening the macros GUI builds and saves the VSTA project automatically.

Note: When you reopen Visual Studio using Alt+F12, the VSTA project is not automatically saved.

Compatibility

This section provides information about compatibility.

VSTA 2022 does not support VSTA 2.0 projects but you can upgrade them. For more information, see Project Upgrade Dialog Box.

Any custom references added to a VSTA 2.0 project should remain valid after the migration, provided that the custom reference is still registered in the global assembly cache.

User Interface

This section discusses GUI changes related to VSTA 2022 integration.

Macros Dialog Box

With VSTA 2022, editing and debugging occurs with Visual Studio. Therefore, some VSTA 2.0 integration features are removed from the host, such as creating or deleting macros. In addition, the following GUI elements are removed from the macros GUI:

  • The Create a macro, Delete a macro, Rename a macro commands
  • The Activation of the debug mode check box

Project Upgrade Dialog Box

To be able to open VSTA projects created with VSTA 2.0, you need to upgrade them to VSTA 2022. A dialog box prompts you to confirm the upgrade in interactive mode.

Limitations

This section describes known limitations with the migration from VSTA 2.0 to VSTA 2022.

In VSTA 2.0, all runable macros were non-static methods because you could maintain a state between calls. This feature is not available in VSTA 2022. As a consequence, although build time compatibility should be ensured, runtime may not work properly for some upgraded VSTA projects (essentially for macros that rely heavily on the state functionality). Instances are generated to be able to invoke non-static methods.

Note: The migration of VSTA projects that do not comply with Dassault Systèmes' VSTA template is not supported.