WSM API v25.0.0 (2025.0.0)
Loading...
Searching...
No Matches
Getting Started with WSM

Getting Started

Download

The WSM API is currently distributed as part of the FormIt SDK package, which is available for download from Autodesk Artifactory:

Download FormIt SDK

Install the FormIt SDK at the desired path (<FORMIT_SDK_PATH>).

Also see the readme.md for an overview of the package contents, which includes the WSM headers, libraries, and sample code.

Supported Platforms

Platform Architecture Build WSM Library
Windows 32bit and 64bit Release and Debug Static or Shared (.lib/.dll)

WSM is also compiled to JavaScript for Web.

Building Applications

Include WSM

Add the SDK include directory to the include search path of the application build settings:

    <FORMIT_SDK_PATH>/include

Link with WSM

Add the appropriate platform-dependent SDK lib directory to the library search path of the application linker settings:

    <FORMIT_SDK_PATH>/lib/<platform>/<arch>/[Debug|Release]

and specify the appropriate platform-dependent input library file 'WSM.<libext>' for linking.

API Overview

The main header file is WSMApi.h, which publishes over 200 API functions for accessing WSM's modeling functionality. Other headers provide supporting WSM macros, constants, enums, data structures, and classes. Of note is the optional journaling feature, which journals all APIs to JavaScript.

In WSM, read-only APIs are thread-safe and are marked explicitly in the function name, e.g. WSM::APIRayFireReadOnly() and WSM::APIGetBoxReadOnly().

WSM maintains one global variable for storing active Histories and journaling information.

All cached data is computed at the end of a given API, e.g. Planes, bounding boxes, History trees, facet trees on Faces, etc.

WSM also makes extensive use of box trees for performance.

See the WSM API File List, WSM API Reference List, and the WSM Namespace Reference.

Sample Code

To demonstrate WSM API usage, sample code is available under <FORMIT_SDK_PATH>/samples/ and documented in the Sample Code page.

To generate a build project for each sample:

cd <FORMIT_SDK_PATH>/samples/
python3 Generate_Project.py # [-h,--help] to display options

Journaling

The Journaling feature in FormIt Pyramid provides a good way to see how WSM APIs can be used. When enabled, all APIs are journaled to JavaScript. It is recommended to turn off read-only APIs, to omit numerous API calls that occur for frustum picks (see Journaling options in Pyramid). Journals can be saved from Pyramid, then after removing intermediate drag face and undo calls, can be converted to C++. The WSM JavaScript API signatures are very close to the C++ API.

For example, see sample_journaling.js and sample_journaling.cpp.