Hello!
When opening drawing via Database.ReadDwgFile cannot reset ucs to world
Database db
= new Database
(false,
true); db.ReadDwgFile(path, System.IO.FileShare.ReadWrite, true, null);
using (Transaction tr = db.TransactionManager.StartTransaction())
{
ViewportTable vt = (ViewportTable)tr.GetObject(db.ViewportTableId, OpenMode.ForRead);
ViewportTableRecord vtr = (ViewportTableRecord)tr.GetObject(vt["*Active"], OpenMode.ForWrite);
vtr.SetUcsToWorld();
tr.Commit();
}
db.SaveAs(path, Db.DwgVersion.Current);
Also vtr.SetUcsToWorld(); doesn't work with active drawing.
One moment for 2014: UCS Icon sometimes goes to WCS position, but UCS itself stays in the old place