在WinForm中能夠方便的集成AnyCAD.Net三維控件,只須要如下幾部便可完成。html
1、添加DLL程序集this
AnyCAD.Foundation.Net.dllspa
AnyCAD.Presentation.Net.dll3d
AnyCAD.Exchange.Net.dllcode
2、初始化控件orm
1.首先建立一個窗體htm
2.在窗體上放置一個Panel用來放置三維控件blog
3.初始化控件ci
完整代碼以下:get
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
public
partial
class
MainForm : Form
{
private
RenderWindow3d m_RenderView =
null
;
public
AnyCAD.Presentation.RenderWindow3d RenderView
{
get
{
return
m_RenderView; }
set
{ m_RenderView = value; }
}
public
MainForm()
{
InitializeComponent();
// Add 3D RenderView to container.
var
container =
this
.splitContainer1.Panel2;
m_RenderView =
new
RenderWindow3d();
m_RenderView.Size = container.ClientSize;
m_RenderView.Dock = System.Windows.Forms.DockStyle.Fill;
container.Controls.Add(m_RenderView);
}
}
|
編譯運行,效果以下:
3、注意事項
1. 請確保把sdk的dll複製到程序exe文件所在的目錄。
2. 請關注SDK的更新:http://pan.baidu.com/share/home?uk=3474438112
https://www.cnblogs.com/anycad/p/4888012.html