Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using this code to rename dwg files from a third party. The insunits are set to "2" (feet). I thought I could change the units at the same time, but it is not working.
We work in metres (insunits = "6").
string dwgname = "dwg from third party";
string newname = "newname.dwg";
string savepath = "c:\\temp\\";
using (Database db = new Database(false, true)) { db.ReadDwgFile(dwgname, FileOpenMode.OpenForReadAndWriteNoShare, false, ""); db.CloseInput(true); using (Transaction tr = db.TransactionManager.StartTransaction()) { Application.SetSystemVariable("INSUNITS", 6); tr.Commit(); }// using tr db.SaveAs(savepath + newname, DwgVersion.Current);
}// using new database
What is the correct procedure?
Solved! Go to Solution.