Point3dCollection col_point = new Point3dCollection();
 Line ent_line = item as Line;
                    Point3d startPoint = ent_line.StartPoint;
                    Point3d endPoint = ent_line.EndPoint;
                    col_point.Add(startPoint);
                    col_point.Add(endPoint);

                    Polyline poly = new Polyline();

                    poly.Color = reg.Color;
                    poly.Closed = true;
                    poly.LineWeight = reg.LineWeight;
                    poly.LinetypeId = reg.LinetypeId;
                    PolylineTools.CreatePolyline(poly, col_point);

                    btr.AppendEntity(poly);
                    trans.AddNewlyCreatedDBObject(poly, true);


本文转载:CSDN博客