Multi-Delete Layouts
Hello all BCad users,
Sorry if this tread is open elsewere, but, can you say if it's possible to multi-delete layout on Bricscad V15? Doing this in a proj with 50+ layout it's hard.
Please help.
Many thank's.
Luis.
0
Comments
-
Hi,
You can do it in Drawing Explorer-Page Setups.0 -
Thank you Marin, it works fine.Regards,Luis0
-
Cool trick, wish I had know about that a few months ago...0
-
[code];;; Delete all layouts(defun c:DeleteLayouts ( / name cname)(vl-load-com)(setvar "cmdecho" 0)(setq cname (SDG_Get_CLayout));; if in modelspace, create new blank layout to allow deletion of all existing paperspace(if (= "Model" cname) (command "layout" "new" (setq name (strcat "temp_" (rtos (getvar "cdate") 2 6)))))(vlax-for x (vla-get-layouts(vla-get-activedocument (vlax-get-acad-object)))(if (and (/= "Model" (vla-get-name x))(/= name (vla-get-name x))(/= cname (vla-get-name x))) ;_and(vla-delete x)))(if (= "Model" cname) (command "layout" "rename" name "Layout1"))(setvar "cmdecho" 1)(princ));;;=========================================================================;;; Get current layout as string;;;=========================================================================(defun SDG_Get_CLayout ( / clayout)(if (SDG_is_paper) ;if paperspace, return layout name(setq clayout (vla-get-activedocument (vlax-get-acad-object))clayout (vla-get-name (vla-get-layout (vla-get-paperspace clayout))))"Model"));;;=========================================================================;;; SDG_is_paper - returns nil for modelspace, T for paperspace;;; by Vladimir Nesterovsky;;; use (cons 67 (if (SDG_is_paper) 1 0)) for ssget "X" of mspace vs. pspace;;; note that pspace will get all objects in layouts, not just current;;;=========================================================================(defun SDG_is_paper () (> 2 (getvar "cvport") (getvar "tilemode")))[/code]0
-
Thank you for the code. It helps, but... only if i want to del all layouts, yes?It's a start.Regards,Luis0
-
It deletes all layouts but current, if you are in a paperspace layout. You could easily add an option to do a name check. Or check into dos_lib GUI functions to make dialog with list of layouts for selection.0
This discussion has been closed.