作者: littleboy 2025-03-04 16:19:07

eDrawings_获得对象

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using eDrawingHostControl;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
eDrawingHostControl.eDrawingControl ctrl = null;
public Form1()
{
InitializeComponent();
if (null == ctrl)
{
ctrl = new eDrawingControl();
}
this.Controls.Add(ctrl);
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
if(ctrl != null)
{
ctrl.Location = new Point(0,0);
ctrl.Size = new System.Drawing.Size(this.Size.Width,this.Size.Height);
ctrl.eDrawingControlWrapper.OpenDoc("C:\\Users\\Public\\Documents\\SOLIDWORKS\\SOLIDWORKS 2020\\samples\\tutorial\\EDraw\\claw\\claw.sldprt", false, false, false, "");
}
}
}
}

参考

Save Method (IEModelViewControl) - 2022 - SOLIDWORKS API Help