Author Topic: Working with ucs without Editor  (Read 1351 times)

0 Members and 1 Guest are viewing this topic.

bargool

  • Guest
Working with ucs without Editor
« on: February 26, 2014, 02:05:39 AM »
Hello!
When opening drawing via Database.ReadDwgFile cannot reset ucs to world
Code - C#: [Select]
  1.     Database db= new Database(false, true);
  2.     db.ReadDwgFile(path, System.IO.FileShare.ReadWrite, true, null);
  3.     using (Transaction tr = db.TransactionManager.StartTransaction())
  4.     {
  5.             ViewportTable vt = (ViewportTable)tr.GetObject(db.ViewportTableId, OpenMode.ForRead);
  6.             ViewportTableRecord vtr = (ViewportTableRecord)tr.GetObject(vt["*Active"], OpenMode.ForWrite);
  7.             vtr.SetUcsToWorld();
  8.             tr.Commit();
  9.     }
  10.    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