Real_King 发表于 2015-8-4 16:17:00

遇到几个ReverseCurve无法换向的polyline,原因不明,请大神研究下

附件已上传,不存在重复点问题
在CASS中使用H命令换向也没有用
复制代码

    public void FX()
    {
      Autodesk..ApplicationServices.Document DOC = AcadApp.DocumentManager.MdiActiveDocument;
      Autodesk.AutoCAD.EditorInput.Editor ed = DOC.Editor; Database db = HostApplicationServices.WorkingDatabase;
      PromptEntityOptions CADentity_PEO = new PromptEntityOptions("\n请准确选择PL线");
      CADentity_PEO.SetRejectMessage("\n所选实体非PL线.");
      CADentity_PEO.AddAllowedClass(typeof(Polyline), true);
      PromptEntityResult CADentity_RST = ed.GetEntity(CADentity_PEO);
      if (CADentity_RST.Status == PromptStatus.OK)
      {
      using (DocumentLock DOClock = DOC.LockDocument())
      {
          using (Transaction trans = db.TransactionManager.StartTransaction())
          {
            BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForRead); //以读方式打开块表.
            BlockTableRecord btr = (BlockTableRecord)trans.GetObject(bt, OpenMode.ForWrite);
            Polyline ZDline = CADentity_RST.ObjectId.GetObject(OpenMode.ForWrite) as Polyline; //宗地线
            if (!(ZDline.Clockwise())) { ZDline.ReverseCurve(); MessageBox.Show("逆时针已成顺时针"); }
            else { MessageBox.Show("SSZ"); }
            trans.Commit();
          }
      }
      }
    }**** Hidden Message *****
页: [1]
查看完整版本: 遇到几个ReverseCurve无法换向的polyline,原因不明,请大神研究下