Anycad three-dimensional controls have a. NET version and two versions of C + +, using C + + is a little more complicated than C #. The SDK provides an encapsulation of the document view for MFC, with just a few base classes to change.
Get ready
Project Settings
$ (ANYCADSDK) is replaced with the location of your project relative to the Anycad C + + SDK, or you can add ANYCADSDK to the environment variable.
$ (ANYCADSDK) \inc
$ (ANYCADSDK) \lib\$ (Configuration) \
AnyPlatformAPI.lib; AnyPlatformMFC.lib
#include "View/anysdk.h"
MFC related base class modification
Replace the above class with auwinapp<cwinapp> or AUWINAPP<CWINAPPEX>, including CPP files.
CMainFrame: For multi-Document application CMainFrame the base class is changed to aumainframe<cmdiframewnd>; for single document application base class to Aumainframe<cframewnd>
CView: Replace the class that requires three-dimensional display with auview3d, including the CPP file.
The display engine-related objects can be obtained by accessing the M_VIEW3D members of the auview3d.
Use the Ribbon-style interface
Show first Model
void
CSampleView::OnButtonSphere()
{
using
namespace
AnyCAD::API;
auto
sphere = BrepTools().MakeSphere(Vector3(0,0,0),100);
ShowGeometry(sphere, 101, 1);
}
So far so easy!
Note: The sample code above is included in the sample project that accompanies the SDK.
Using Anycad three-dimensional controls in an MFC program