Hi Everyone,
I need some help, how to convert following C# code into
powerscript inPowerBuilder Classic 12.5:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Autodesk.AutoCAD; //申明CAD空间 using Autodesk.AutoCAD.Interop; using Autodesk.AutoCAD.Interop.Common; //测试环境 AutoCAD12 //引用版本 AutoCAD 2012 Type Library //引用DBX版本 AutoCAD/ObjectDBX Common 16.0 Type Library //引用 Microsoft.VisualBasic.dll //不要开其它版本测试 namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } Autodesk.AutoCAD.Interop.AcadApplication AcadApp; //申明CAD Autodesk.AutoCAD.Interop.AcadDocument AcadDoc; //申明文档 private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { double[] Po =new double[3]{0, 0, 0}; //默认起点 // 循环使用多个点时,后面将Pt的值给到Po; AcadApp = (AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject("AutoCAD.Application"); Microsoft.VisualBasic.Interaction.AppActivate(AcadApp.Caption); //激活当前打开的CAD图档 AcadDoc = AcadApp.ActiveDocument; //将文档移动当前激活的图档 Object Vart = AcadDoc.Utility.GetPoint(Po, "请拾取坐标点:"); //定义用户选取的点坐标对象 double[] Pt = (Double[])Vart; //将制将点对象转化为双精度数值 textBox1.Text =Pt[0].ToString(); //将双精度数值转为字符串,传回窗体 textBox2.Text = Pt[1].ToString(); textBox3.Text = Pt[2].ToString(); } } }
Thanks
regards