附件已上传,不存在重复点问题
在CASS中使用H命令换向也没有用
复制代码
-
- [CommandMethod("FX")]
- 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[BlockTableRecord.ModelSpace], 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();
- }
- }
- }
- }
本帖以下内容被隐藏保护;需要你回复后,才能看到! 游客,如果您要查看本帖隐藏内容请 回复 |