Have disagree this code by Alexander is working good enough with aby type of curves [CommandMethod("3ps")] public static void test3dp() { // some dummy points for test Point3dCollection points = new Point3dCollection() { new Point3d(5, 15, 10), new Point3d(25, 20, 0), new Point3d(30, 5, -10), new Point3d(10, 10, 5) }; // create closed 3dpoly create3dPoly(HostApplicationServices.WorkingDatabase, points, true); } // code borrowed from Fenton Webb, Autodesk, 15/06/2012 static public void create3dPoly(Database db,Point3dCollection points,bool closed) { Transaction tr = db.TransactionManager.StartTransaction(); using (tr) { // Create a 3D polyline with two segments (3 points) using (Polyline3d poly3d = new Polyline3d()) { poly3d.SetDatabaseDefaults(); // Add the new object to the current space block table record using (BlockTableRecord btr = tr.GetObject(db.CurrentSpaceId,OpenMode.ForWrite) as BlockTableRecord) { // because before adding vertexes, the polyline must be in the drawing btr.AppendEntity(poly3d); foreach (Point3d pnt in points) { // now create the vertices using (PolylineVertex3d poly3dVertex = new PolylineVertex3d(pnt)) // and add them to the 3dpoly (this adds them to the db also poly3d.AppendVertex(poly3dVertex); } } poly3d.Closed = closed; } tr.Commit(); }//end using transaction }
_____________________________________
C6309D9E0751D165D0934D0621DFF27919