poly_ArcsLines(this ObjectId idPoly, string nameLayer) { List <ObjectId> ids = new List <ObjectId>(); using (var tr = BaseObjs.startTransactionDb()){ Polyline poly = (Polyline)tr.GetObject(idPoly, OpenMode.ForWrite); for (int i = 1; i < poly.NumberOfVertices; i++) { double bulge = poly.GetBulgeAt(i - 1); if (bulge == 0) { ObjectId id = Draw.addLine(poly.GetPoint3dAt(i - 1), poly.GetPoint3dAt(i), nameLayer); id.changeProp(clr.red); BaseObjs.updateGraphics(); ids.Add(id); } else { ObjectId id = Draw.addArc(poly.GetPoint3dAt(i - 1), poly.GetPoint3dAt(i), bulge, nameLayer); id.changeProp(clr.red); BaseObjs.updateGraphics(); ids.Add(id); } } tr.Commit(); } return(ids); }
drawBounds(this Entity ent) { idLast.changeProp(clr.mag); BaseObjs.updateGraphics(); Extents3d xtnts3d = (Extents3d)ent.Bounds; Point3d pnt3dLL = xtnts3d.MinPoint; Point3d pnt3dUR = xtnts3d.MaxPoint; Point3d pnt3dLR = new Point3d(pnt3dUR.X, pnt3dLL.Y, 0); Point3d pnt3dUL = new Point3d(pnt3dLL.X, pnt3dUR.Y, 0); List <Point3d> pnts3d = new List <Point3d> { pnt3dLL, pnt3dLR, pnt3dUR, pnt3dUL, pnt3dLL }; ObjectId idPoly = pnts3d.addPoly3d(); idPoly.changeProp(clr.yel); BaseObjs.updateGraphics(); idLast = idPoly; }