几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(VB.NET/C#) (http://www.dimcax.com/hust/forumdisplay.php?f=176)
-   -   【转帖】c#中直接保存.dwg文件的问题 (http://www.dimcax.com/hust/showthread.php?t=8859)

yang686526 2009-04-20 10:33 AM

【转帖】c#中直接保存.dwg文件的问题
 
c#中直接保存.dwg文件的问题
www.dimcax.com
c#中直接保存.dwg文件的问题
这是我的代码: autodesk.autocad.interop.acadapplication a_cadapp; a_cadapp = new acadapplicationclass(); try { a_cadapp.visible = false; //autodesk.autocad.interop.acaddocument a_doc; //a_doc = new acaddocument(); a_cadapp.activedocument.modelspace.addline(new double[] { 10, 10, 0 }, new double[] { 100, 100, 0 }); a_cadapp.activedocument.modelspace.addcircle(new double[] { 10, 10, 0 }, 60); a_cadapp.activedocument.saveas("e:\\2.dwg", type.missing, type.missing); a_cadapp.documents.close(); a_cadapp.quit(); if (a_cadapp != null) { system.runtime.interopservices.marshal.releasecomobject(a_cadapp); a_cadapp = null; } gc.collect(); 问题是运行很不稳定,总是重起,而且速度很慢。请高手指点。
你这个是com方式的编程,为什么不用.net的方式呢?
c#最适合开发autocad,因为它拥有vb容易的特点,却具有vc++的强大功能。


所有的时间均为北京时间。 现在的时间是 03:16 PM.