Esempio n. 1
0
 Polyline2d ClonePolyline2d(Polyline2d oldEnt)
 {
     try
     {
         Point3dCollection vertices   = new Point3dCollection();
         DoubleCollection  bulges     = new DoubleCollection();;
         IEnumerator       Enumerator = oldEnt.GetEnumerator();
         while (Enumerator.MoveNext())
         {
             ObjectId id  = (ObjectId)Enumerator.Current;
             Vertex2d vtx = (Vertex2d)id.GetObject(OpenMode.ForWrite);
             vertices.Add(vtx.Position);
             bulges.Add(vtx.Bulge);
             vtx.Dispose();
         }
         return(new Polyline2d(oldEnt.PolyType, vertices, oldEnt.Elevation, oldEnt.Closed, oldEnt.DefaultStartWidth, oldEnt.DefaultEndWidth, bulges));
     }
     catch (Exception ex)
     {
         Logger.log("ClonePolyline2d", ex.Message);
     }
     return(null);
 }