CwAPI3D.Net.Bridge
0.0.1
See the version list below for details.
dotnet add package CwAPI3D.Net.Bridge --version 0.0.1
NuGet\Install-Package CwAPI3D.Net.Bridge -Version 0.0.1
<PackageReference Include="CwAPI3D.Net.Bridge" Version="0.0.1" />
<PackageVersion Include="CwAPI3D.Net.Bridge" Version="0.0.1" />
<PackageReference Include="CwAPI3D.Net.Bridge" />
paket add CwAPI3D.Net.Bridge --version 0.0.1
#r "nuget: CwAPI3D.Net.Bridge, 0.0.1"
#:package CwAPI3D.Net.Bridge@0.0.1
#addin nuget:?package=CwAPI3D.Net.Bridge&version=0.0.1
#tool nuget:?package=CwAPI3D.Net.Bridge&version=0.0.1
CwAPI3D_CSharp
This project serves as a .NET bridge for the C++ API from Cadwork 3D. It leverages the power of C++ CLI (Common Language Infrastructure) to provide a seamless integration between the .NET environment and the Cadwork 3D API. This allows developers to utilize the robust features of cadwork 3D API within their .NET applications.
Getting Started
Clone the repository to your local machine.
git clone https://github.com/Brunner246/CwAPI3D_CSharp.git
Update the macros in CwAPI3D.props to point to the correct paths for cadwork. The macros are used to include the necessary headers and for copying the DLLs as a post-build event into the userprofile directory.
<PropertyGroup Label="UserMacros">
<CwAPI3D>./CwAPI3D/includes</CwAPI3D>
<USERPROFILE_API>D:\cadwork\userprofil_30\3d\API.x64</USERPROFILE_API>
<AssemblyName>CwAPI3D_CSharp</AssemblyName>
<API_NAME>CwAPI3D_CSharp</API_NAME>
</PropertyGroup>
Prerequisites
- Visual Studio 2022 or JetBrains Rider
- .NET Framework 4.8
- Install C++/CLI support in Visual Studio (Visual Studio Installer → Modify → Individual Components → C++/CLI support)
C++ CLI
Walkthrough: Compile a C++/CLI program
C++/CLI Syntax
using namespace System;
////////////////////////// managed C# code //////////////////////////
public ref class Greeter
{
public:
Greeter(String^ name)
{
this->name = name;
}
String^ Greet()
{
return "Hello, " + name;
}
private:
String^ name;
}
////////////////////////// native CXX code //////////////////////////
public ref class MyClass
{
public:
MyClass()
{
mPoint = new C3dPoint();
}
explicit MyClass(const double aX, const double aY, const double aZ)
{
Console::WriteLine("Hello from C++/CLI!");
mPoint = new C3dPoint(aX, aY, aZ);
}
explicit MyClass(const C3dPoint% p)
{
mPoint = new C3dPoint(p);
}
// Destructor
~MyClass()
{
this->!MyClass();
}
// Finalizer
!MyClass()
{
Console::WriteLine("Finalizer from C++/CLI!");
delete mPoint;
}
property C3dPoint* Point
{
C3dPoint* get()
{
return mPoint;
}
}
private:
C3dPoint* mPoint;
};
Debugging
Debugging in Visual Studio
- Open the project in Visual Studio.
- Set the project to run in 64-bit mode.
- Set the project to run in Debug mode.
- Attach the debugger to the process
3d.exe.
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Contributing Back
If you extend or improve the CwAPI3D bridge, please commit your changes back to this repository. This way, all users can benefit from the enhancements. Your contributions help make the CwAPI3D .NET bridge better for everyone.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.