VSTA 2017 Integration

With the integration of VSTA 2017 integration many changes have been introduced, for example, an installation of Visual Studio 2012, Visual Studio 2013 or Visual Studio 2017 (Pro or Community Edition) is required to edit VSTA macros.

VSTA 2017 is based on the .NET Framework 4.6.2. It contains a new version of the Common Language Runtime allowing VSTA 2017 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 is used for editing 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. Instead, you need to acquire and install Visual Studio 2012, Visual Studio 2013 or Visual Studio 2017 (Pro or Community Edition) to edit VSTA macros. Otherwise, you will only be 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 2017, once a VSTA macro library is opened in the 3DEXPERIENCE platform, the VSTA project is loaded in Visual Studio. You can now 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 is controlled exclusively from Visual Studio:

  • Each project has now 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 are kept in memory as long as a macro library is opened. When closing Visual Studio, if you do not save the project when prompted, you will not lose pending modifications until you close the macro library. You can then reopen Visual Studio to continue editing the project.

Warning: You have to close Visual Studio before closing the 3DEXPERIENCE platform. Otherwise, you will not be prompt to save your changes. Any unsaved changes will be lost.

Selecting a macro library in the Macro libraries dialog box or reopening the macros GUI will build and save 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 2017 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 2017 integration.

Macros Dialog Box

With VSTA 2017, edition and debugging are handled by Visual Studio. As a result, some VSTA 2.0 integration features have been removed from the host, such as creating or deleting macros. In addition, the following GUI elements have been 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 2017. 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 2017.

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 2017. 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 on the fly 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.