- private void 获取对象名称_Click(object sender, EventArgs e)
- {
- Microsoft.VisualBasic.Interaction.AppActivate(AcadApp.Caption);
- object returnObj,pickPoint;
- string pickPrompt = "选取物体对象!";
- double[] pickPointArray;
- AcadDoc.Utility.GetEntity(out returnObj, out pickPoint, pickPrompt);
- AcadObject returnCADObj = (AcadObject)returnObj;
- pickPointArray =(Double[])pickPoint;
- MessageBox.Show("选取对象为:" + returnCADObj.ObjectName.ToString());
- MessageBox.Show("点击位置:X=" + pickPointArray[0].ToString() + ",Y=" +
- pickPointArray[1].ToString() + ",Z=" + pickPointArray[2].ToString());
- Microsoft.VisualBasic.Interaction.AppActivate(this.Text);
- }
书上的方法是这样的 但是当在屏幕空白处点击孤立点时就报错,请问如何获取屏幕空白处点选的点的坐标?
|