(defun DelPgSetups ( / appAcad colPgSetups docCurrent objPgSetup) ;Subroutine added to delete existing page setups before adding new ones (vl-load-com) (setq appAcad (vlax-get-acad-object) ;get the ACAD application object docCurrent (vla-get-ActiveDocument appAcad) ;get the current drawing ;get the ACAD_PLOTSETTINGS dictionary colPgSetups (vla-get-PlotConfigurations docCurrent)) ;setq ;get each page setup in the ACAD_PLOTSETTINGS dictionary (vlax-for objPgSetup colPgSetups (prompt "\nDeleting existing Page Setups...") (princ (strcat "\nDeleting " (vla-get-name objPgSetup) "...")) (vla-delete objPgSetup) ;delete the page setup from the dictionary (vlax-release-object objPgSetup) ;release the page setup );vlax-for (princ "\n\nDone.") ;release objects from memory (vlax-release-object colPgSetups) (vlax-release-object docCurrent) (vlax-release-object appAcad) ;(command "_redefine" "_plot") ) ;End of code for DelPgSetups Subroutine (DelpgSetups) ;Calls subroutine then carries on remainder of the program (SETQ CMDST (GETVAR "CMDECHO")) ;Save SMDECHO STATUS (setvar "cmdecho" 0) (setq done T) ;(command "_PSETUPIN" "PLOTVORLAGE.dwg" "*") (command "_PSETUPIN" "C:\\SHS-Menue\\Lisp-VBA\\Plot-Seiteneinrichtungen_aktualisieren\\Plotvorlage.dwg" "*") ;Import all the Pagesetups (while (= (getvar "CMDNAMES") "_PSETUPIN") (command "y" ) (setq done nil)) ;end while (setvar "cmdecho" CMDST) ;RESET CMDECHO Status (prompt "\n New PageSetups have been imported") (princ) ;End routine