代码如下: private AcadApplication a;//声明AutoCAD对象 a = new AcadApplicationClass();//创建AutoCAD对象 short[] filterType=new short[2]; object [] filterData = new object[2]; filterType[0]=0; filterData[0]="circle"; filterType[1] = 8; filterData[1] = "layer1"; try { AutoCAD.AcadSelectionSet set = a.ActiveDocument.SelectionSets.Add("test");//执行这句后,跟踪set的count是0 set.Select(AcSelect.acSelectionSetAll, null, null, filterType, filterType);//执行这句后,提示对com的调用返回HRESULT-FAIL set.Highlight(true);//高亮显示 } catch (Exception ex) { MessageBox.Show(ex.Message); } 请问这个方法该如何调用,是程序哪里出了问题?我使用的是cad2004,.net2005,arxforcad2004.请各位多多指教!谢谢! |