This project demonstrates how to use the CwAPI3D library. The example plugin initializes a connection with the CAD application, retrieves active elements, and prints their names to the console.
- CMake
- A C++ compiler
- CwAPI3D library
-
Clone the repository:
git clone https://github.com/cwapi3d/cwapi3dCppExample.git cd cwapi3dCppExample
-
Create a build directory and configure the project using CMake:
cmake -S . -B build
-
Build the project:
cmake --build build
- Ensure that the CAD application is running and the CwAPI3D library is properly configured.
- Load the compiled plugin into the CAD application.
- The plugin will print the names of active elements to the console.
This file contains the main logic for the plugin. The plugin_x64_init
function initializes the plugin, retrieves active elements, and prints their names to the console.
plugin_x64_init(CwAPI3D::ControllerFactory *aFactory)
: Initializes the plugin and interacts with the CAD application.
Attach a debugger to the CAD application to debug the plugin.
For example, use Visual Studio to attach to the CAD application process. See the launch.json file for the configuration.