今天把所有的AddToModelSpace和AddToPaperSpace修改成了AddToCurrentSpace.

近日发现一个问题,我测试时没有问题,但是用户在用的时候说没有看到新的文字出现,我是到处找问题,最后才发现问题出现在AddToModelSpace这一句了。

    public static ObjectIdCollection AddToCurrentSpace(this Database db, params Entity[] ents)
    {
      ObjectIdCollection ids = new ObjectIdCollection();
      var trans = db.TransactionManager;
      BlockTableRecord btr = (BlockTableRecord)trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
      foreach (var ent in ents)
      {
        ids.Add(btr.AppendEntity(ent));
        trans.AddNewlyCreatedDBObject(ent, true);
      }
      btr.DowngradeOpen();
      return ids;
    }

  

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案