using (Transaction tr = db.TransactionManager.StartTransaction())
public void Aba(int Width) { Document doc = AcAp.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; //PromptEntityResult selRes = ed.GetEntity("\nPick a Curve entity:"); PromptSelectionOptions selOp = new PromptSelectionOptions(); PromptSelectionResult selRes = ed.GetSelection(selOp); PromptKeywordOptions chRes = new PromptKeywordOptions("\nVuong hay khong?[Y/N]:", "Y N"); chRes.Keywords.Default = "Y"; PromptResult pStrRes = ed.GetKeywords(chRes); try { using (Transaction tr = db.TransactionManager.StartTransaction()) { if (selRes.Status == PromptStatus.OK) { SelectionSet acSSet = selRes.Value; // Step through the objects in the selection set foreach (SelectedObject acSSObj in acSSet) { Entity ent = (Entity)tr.GetObject(acSSObj.ObjectId, OpenMode.ForRead); double angle = GetAngle(ent as Curve); int CurLenght = Convert.ToInt32((GetLength(ent as Curve)));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)