示例#1
0
        public static void Run()
        {
            var pl = new AcPolygonsCreator();

            pl.LoadLinesData();
            pl.BuildPolygons();
            AcRemoveDuplicatedPolygons.Run();
        }
示例#2
0
        public static void Run()
        {
            using (var trans = Ac.StartTransaction())
            {
                var polylines        = trans.GetAllEntities <Polyline>();
                var polygons         = polylines.Where(p => p.Closed == true).ToList();
                var polygonsByLength = polygons.ToLookup(p => p.Length.ToString(Ac.LinearPrecisionFormat));

                Ac.InitProgress(AppServices.Strings.DeletingDuplicates, polygonsByLength.Count);
                Ac.WriteLn(AppServices.Strings.DeletingDuplicates);

                foreach (var polygonsWithLength in polygonsByLength)
                {
                    var ents = polygonsWithLength.ConvertTo <Entity>();
                    AcRemoveDuplicatedPolygons rdp = new AcRemoveDuplicatedPolygons();
                    rdp.Run(ents, false);
                    Ac.ProgressStep();
                }
                Ac.ClearProgress();
                trans.Commit();
            }
        }