usingAutodesk.AutoCAD.ApplicationServices;usingAutodesk.AutoCAD.DatabaseServices;usingAutodesk.AutoCAD.EditorInput;usingAutodesk.AutoCAD.Runtime;usingAutodesk.AutoCAD.Geometry;usingAutodesk.AutoCAD.GraphicsInterface;usingAutodesk.AutoCAD.Colors;//_____________________________________//[CommandMethod("colseg")]public voidColoredSegment()
{
Document doc=Application.DocumentManager.MdiActiveDocument;
Database db=doc.Database;
Editor ed=doc.Editor;
PromptEntityOptions peo= new PromptEntityOptions("\nSelect Segment of Polyline:");
peo.SetRejectMessage("\nMust be a Polyline!");
peo.AddAllowedClass(typeof(Autodesk.AutoCAD.DatabaseServices.Polyline), false);
PromptEntityResult per=ed.GetEntity(peo);if (per.Status !=PromptStatus.OK)return;
Transaction tr=db.TransactionManager.StartTransaction();
Autodesk.AutoCAD