System requirements
The Ansys Motion Standalone Preprocessor C# Library requires a development environment with the .NET Framework version 4.8.Common Settings
First, you need to create a new C# project for the .NET class library. It’s different for your development environment. This document uses Visual Studio 2022 as an example.Create C# project
Create a new .NET Framework class library as follows:
Add reference
Add the assembly from the Ansys Motion Standalone Preprocessor C# library to the project references.
License setting
First, add the reference “Ansys installed path\Motion\bin\VMLNet.dll”. Then add the following code snippet to any source code in the project.Create new external module for the Ansys Motion Standalone Preprocessor
Please note that all steps of the Common Settings must be done before. The following code shows the source code for displaying a message box.Execute the external module from Ansys Motion Standalone Preprocessor
The new external module can be executed from the ‘Home→Execute External Module File…’ menu of the Ansys Motion Standalone Preprocessor.
Create a new operation module and add it to the ribbon menu of the Ansys Motion Standalone Preprocessor
After setting up the Common Settings, add the following code to the project.Add new button to the ribbon menu
Create new ribbon resource files ‘Ansys installed path\Motion\bin\Templates\Resources\TestOpearation.dfresx’ as follow:
See also
- The sample code of the Ansys Motion Preprocessor C# library is available in the ‘Ansys installed path\Motion\Document\API Tutorial.zip’ file.
- Reference