Error Layout not initialized
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have the following problem: When I run the following Lisp and then want to publish it, I get the following error message: Layout not initialized. However, the page settings are correctly assigned for all layouts. However, if I manually delete the layouts that I don't need and then click publish, this error message does not appear and I can publish without any problems. Does anyone know a solution to use the Lisp and not get an error message when publishing?
Code:
(defun c:Dellay()
(vl-load-com)
(SETVAR "CMDECHO" 0)
(command "_undo" "_begin")
(setvar 'ctab "Model")
;; Initialisiere die Liste der Layout-Namen
(setq plotabs '())
;; Sammle alle Layout-Namen
(vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
(setq plotabs (cons (vla-get-name lay) plotabs))
)
;; Lösche die Layouts, die "Layout" im Namen haben
(foreach lay plotabs
(if (and (/= lay "Model")
(wcmatch (strcase lay) "*LAYOUT*"))
(progn
(princ (strcat "\nDeleting layout: " lay)) ;; Debugging-Ausgabe
(command "_.layout" "_d" lay)
)
)
)
(command "_undo" "_end")
(SETVAR "CMDECHO" 1)
(princ)
)