几何尺寸与公差论坛------致力于产品几何量公差标准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=9118)

yang686526 2009-04-20 03:40 PM

【转帖】[求助]c#中直接保存.dwg文件的问题
 
[求助]c#中直接保存.dwg文件的问题
[求助]c#中直接保存.dwg文件的问题
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();
问题是运行很不稳定,总是重起,而且速度很慢。请高手指点。

我走的很慢,可我从不后退!
有在.net下直接打开指定路径下的dwg文件的代码吗


所有的时间均为北京时间。 现在的时间是 05:30 AM.