|
发表于 2009-10-11 21:54:00
|
显示全部楼层
已经解决了,这样打开dxf,保存成dxf,dwg,dwt,打开dwg,保存成dxf,dwg,dwt都可以了,不报错了,保存版本和AutoCAD的设置时一致的。
for (iDwg = 0; iDwg
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
//db.CloseInput(true);
DocumentLock lok = doc.LockDocument();
Utils.ZoomObjects(true);//范围缩放视图
lok.Dispose();
//db.Save();
labelExecuteCondition.Text = "正在范围缩放" + System.IO.Path.GetFileName(operFilePath) + "视图,请等待……";
labelExecuteCondition.Visible = true;
finish = (int)((Double)(iDwg + 1) / (Double)(dwgCount) * 100);
progressBar1.Value = finish;
progressBar1.Visible = true;
this.Update();
//savepath = System.IO.Path.GetDirectoryName(operFilePath) + System.IO.Path.GetFileNameWithoutExtension(operFilePath);
//savepath = folderPath+System.IO.Path.GetFileNameWithoutExtension(operFilePath);
//savepath = "D:\\杂记\\1";
savepath = operFilePath;
doc.CloseAndSave(savepath);
}
到这里,我的东西就全做完了
gy32hjqrqxh.jpg
|
|