Author Topic: Delete layout without transaction  (Read 903 times)

0 Members and 1 Guest are viewing this topic.

Offline fixo

  • Full Member
  • ***
  • Posts: 135
  • Karma: +4/-0
  • Gender: Male
    • prefered language: C
    • Prog expertise: Good
    • View Profile
Delete layout without transaction
« on: August 05, 2012, 11:47:41 AM »
Code: [Select]
        [CommandMethod("dellt")]
        public void DelLayout()
        {
           // put desired layout name:
            string laytName = "D-Size Layout";// may have any layout name belongs to current drawing

            LayoutManager laytmgr = LayoutManager.Current;
            try
            {
                laytmgr.DeleteLayout(laytName);

                Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.Regen();
            }
            catch (Autodesk.AutoCAD.Runtime.Exception ex)
            {
                Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage
                    (ex.Message + "\n" + ex.StackTrace);

            }
     
        }

~'J'~