Message 1 of 5
Editor.command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
Below code is working fine for me
[CommandMethod("T")] public void T() { Autodesk.AutoCAD.ApplicationServices.Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; Editor ed = doc.Editor; List<ObjectId> oidlist = GlobalFunction.SS.ClsSelection.GetEntsOnScreen("*", "*"); PromptPointResult ppr = ed.GetPoint(""); Point3d pt1 = ppr.Value; ppr = ed.GetPoint(""); Point3d pt2 = ppr.Value; ppr = ed.GetPoint(""); Point3d pt3 = ppr.Value; ppr = ed.GetPoint(""); Point3d pt4 = ppr.Value; try { ed.Command("_.ALIGN", oidlist[0], "", pt1, pt2, pt3, pt4, "", "Y"); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } MessageBox.Show("Hi"); ed.Command("_.Circle", new Point3d(), 1.0); }
But when i call below line from form button click, it is throwing error invalid input.
ed.Command("_.ALIGN", oidlist[0], "", pt1, pt2, pt3, pt4, "", "Y");
Any one plese help me where i am doing mistake.
Thanks,
Kumar.