[求助]C#的SetXData函数参数问题!
在.NET中对CAD扩展数据问题,错在哪了?<BR>各位大侠:<BR> 小弟正在C#.NET下面学CAD ,发现SetXData参数不对,错在哪了?程序是这样写的吗?请多多指教,谢谢。private void setXData_Click(object sender, System.EventArgs e)<BR> {<BR> object readOnly = false;<BR> object savechange = true;
object[] xdt = new object;<BR> object[] xdv = new object;<BR><BR> xdt=1001; <BR> xdv="扩展数据"; <BR> <BR> xdt=1000; <BR> xdv="扩展数据2";
object miss=System.Reflection.Missing.Value;;<BR> string fileName="E:\\cadGetVar\\mytest.dwg";
AutoCAD.AcadApplicationClass app = new AutoCAD.AcadApplicationClass();<BR> app.Visible=false;<BR> <BR> try<BR> {<BR> <BR> AutoCAD.AcadDocument doc=app.Documents.Open(fileName,readOnly,miss);
doc.ModelSpace.SetXData(xdt,xdv);//SetXData参数不对,错在哪了?<BR> <BR> doc.Save(); <BR> doc.Close(savechange,fileName);<BR> }<BR> catch(Exception ee)<BR> {<BR> MessageBox.Show(ee.ToString ());<BR> }<BR> finally<BR> {<BR> app.Quit ();<BR> }<BR> <BR> }<BR> 晕! <p>晕,多年以前的帖子了.我现在也遇到同样的问题耶?请教一下了</p> short[] xdt = new short;<br/> object[] xdv = new object;<br/><br/> xdt=1001; <br/> xdv="MyTestApp"; <br/> <br/> xdt=1000; <br/> xdv="This is a test";
页:
[1]