The OCC C# Wrapper is a tool for wrapping Open CASCADE Technology (OCCT) C++ classes to C#, allowing their use within .NET applications. The C# interface reuses C++ DLLs and can call C++ methods through C# calls. The wrapping process generates a list of C# files that together form a single C# project interface. This results in a single DLL with modules that correspond to the wrapped OCCT classes.
Benefits of OCC C# Wrapper
True Cross-Platform Development: Ability to use the robust OCCT C++ CAD kernel on both Windows and Linux/Unix environments through .NET, enabling consistent application behavior across all platforms.
Seamless Integration: Easily integrate powerful 3D CAD capabilities into existing .NET applications with minimal effort.
Performance: Maintain the high performance of native C++ code while working in the .NET ecosystem.
Type Safety: Enjoy full IntelliSense support and compile-time type checking for OCCT operations.
Simplified Deployment: Distribute your application with a single wrapped DLL rather than dealing with complex native library dependencies.
Modern Development Experience: Use the latest .NET features and tooling while leveraging the industrial-strength OCCT kernel.
Plugin Architecture Support: Ideal for creating plugins that need CAD functionality for major applications on both Windows and Linux/Unix systems.
C# Wrapper Full Version
The full version of the C# wrapper is a complete package containing all the necessary scripts and files to generate C# files from a C++ OCCT project and build them into a single DLL. After purchasing the full version, you will have the freedom to update the generator based on your needs. The delivery includes the full source package, and you are free to use it in any application you are developing.
Using the purchased scripts, it will be possible to generate wrappers for MacOS as well. The delivery also includes comprehensive instructions for adapting and extending the wrapping mechanism to fit your specific requirements.
Advanced Usage Scenarios
Custom CAD Applications: Build specialized CAD tools tailored to your industry’s unique requirements.
3D Visualization Systems: Create sophisticated visualization solutions with full access to OCCT’s powerful rendering capabilities.
Engineering Analysis Software: Develop applications that combine CAD modeling with engineering analysis and simulation.
Cross-Platform Plugins: Develop plugins with consistent behavior across Windows, Linux, and MacOS environments.
Legacy System Integration: Connect modern .NET applications with existing CAD infrastructure and data formats.
Multi-Platform Enterprise Solutions: Deploy the same codebase across your entire organization regardless of operating system preferences.
C# Wrapper Code Sample
// Reading CAD FILES Sample:
using OCC.TCollection;
using OCC.DE;
using OCC.TDocStd;
using OCC.XCAFApp;
using OCC.STEPCAFControl;
// Load a container for each DE component
var aWrapper = DE_Wrapper.GlobalWrapper().Copy();
// Manually updating parameters for reading CAD files
TCollection_AsciiString thePath = new TCollection_AsciiString("");
DE_Provider? aProvider = null;
if (!aWrapper.FindProvider(thePath, true, aProvider).)
{
// Do something
}
// Modify string with parameters, described in the documentation:
DE_ConfigurationNode aConfig = aProvider.GetNode();
TCollection_AsciiString aParameters = aConfig.Save();
// https://dev.opencascade.org/doc/overview/html/occt_user_guides__de_wrapper.html
aConfig.Load(aParameters);
// Reading CAD file
TDocStd_Document? aDoc = null;
XCAFApp_Application anApp = XCAFApp_Application.GetApplication();
anApp.NewDocument(new TCollection_ExtendedString("BinXCAF"), aDoc);
if (!aProvider.Read(thePath, aDoc))
{
// Do something
}
// Sample to Read using original reader functionality
var aReader = new STEPCAFControl_Reader();
aReader.SetColorMode(true);
if (!aReader.Perform(thePath, aDoc))
{
// Do something
}
Technical Implementation Advantages
The OCC C# Wrapper provides a thoughtfully designed interoperability layer that offers several technical advantages:
Automatic memory management for OCCT objects through C# garbage collection
Efficient marshaling of complex data structures between managed and unmanaged code
Protection against common interoperability issues like memory leaks and dangling pointers
Preservation of OCCT’s object hierarchy and relationships in the C# wrapper
Support for callback mechanisms allowing C++ code to invoke .NET methods
Platform-independent code that works identically on Windows and Linux/Unix
C# Wrapper Overview in Visual Studio
The final result of the wrapping process is a single DLL that can be easily integrated into any C# project. Below is a simple example of how the wrapped DLL appears in the “VS Object Browser”:
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies. However you may visit Cookie Settings to provide a controlled consent.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Preference cookies are used to store user preferences to provide content that is customized and convenient for the users, like the language of the website or the location of the visitor.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Coming Soon
New version of the Personal Account section is under development. We do our best to provide
current and new users with advanced feature set as soon as it is possible.
In the new Personal Account users will be able to:
edit user and company information,
manage access rights for the users of the same company,
sign documents electronically,
view the list of purchased licenses and the order history,
issue technical support tickets and track the progress,
download purchased software,
get access to training materials,
purchase software online using a credit or debit card.
The former version of the Personal Account is available at old.opencascade.com
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Contact Us
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Request a Free Trial
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Request a Live Demo
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Contact Sales
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Request a Quote
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Request for Educational Use
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Customization Request
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
E-learning
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
On-site training
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Apply for a Job
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Apply for an Internship
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Tech Support Request
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Thank you!
The request has been successfully submitted. You can close this
window.
We will contact you shortly during our office hours (Monday to
Friday, 9:00 am — 6:00 pm GMT +1)
Report a Technical Issue
We will contact you shortly during our office hours
(Monday to Friday, 9:00 am — 6:00 pm GMT +1)
Backing your path to digital Future
Mobile version of the website is on development.
Please open the website on your desktop computer.