Rendering custom 3D graphics with Open GL in SOLIDWORKS API

Edit ArticleEdit Article

SOLIDWORKS model is utilizing 3D rendering engines (such as DirectX and OpenGL) to draw the geometry in the graphics area.

SOLIDWORKS API enables 3rd party add-ins and macros to inject 3D graphical objects directly into the model layer using OpenGL functions.

In this case geometry is embedded into the graphics view and transformed together with the model itself. It means that is is not required to calculate the transformation matrix.

OpenGL is the most popular cross-platform library for high performance rendering which is used in gaming, virtual reality, CAD, etc.. Explore the Documentation for more information about this library.

OpenGL graphics should be rendered within the BufferSwapNotify event of IModelView interface.

Such technique of rendering can be useful when it is required to display complex graphics or animation, but creating temp or permanent geometry can be performance consuming or impossible due to the other constraints.

Explore this section for code examples and macros which demonstrate the usage of OpenGL to render objects in views using SOLIDWORKS API.

Notifications

All articles and code at CodeStack are now open-source and hosted on GitHub. If you want to contribute by modifying existing articles and code snippets, submitting new ones, reporting errors and bugs etc. please follow this blog post for more information. We appreciate any contribution.


Product of Xarial Product of Xarial