Hi BIGAL,
I don't have problems using PLOT, but I'm attempting to build the same thing using PUBLISH:
- ; List Layouts in popup list; Select Layouts to plot(defun c:PlotSelected_VLD ( / itm lst BACKGROUNDPLT ) (setq BACKGROUNDPLT (getvar 'BACKGROUNDPLOT)) (setvar "BACKGROUNDPLOT" 0) (setvar 'TRAYTIMEOUT 1) (setq lst (LM:FiltListBox "Select Layouts to Plot" (layoutlist) T )) (foreach itm lst ;; For every 'itm' in the list given by 'lst' (setvar 'LTSCALE 1) (setvar 'PSLTSCALE 0) (setvar 'CTab itm) (COMMAND "-PLOT" "N" "" "" "" "" "N" "Y") (princ (strcat "\nPlotting Layout "" itm "" " )) ) ;; end foreach (if (= (getvar "tilemode") 0) (setvar "tilemode" 1)) ; Go back to MSPACE (princ));;------------------=={ Filtered List Box }==-----------------;;;; ;;;; Displays a list box interface from which the user may ;;;; select one or more items. Includes an edit box filter ;;;; to enable the user to filter the displayed list of items. ;;;;------------------------------------------------------------;;;; Author: Lee Mac, Copyright © 2013 - www.lee-mac.com ;;;;------------------------------------------------------------;;;; Arguments: ;;;; msg - List box dialog title ;;;; lst - List of strings to display in the list box ;;;; mtp - Boolean flag to determine whether the user may ;;;; select multiple items (T=Allow Multiple) ;;;;------------------------------------------------------------;;;; Returns: List of selected items, else nil. ;;;;------------------------------------------------------------;;(defun LM:FiltListBox ( msg lst mtp / _addlist dch dcl des rtn tmp ) (defun _addlist ( key lst ) (start_list key) (foreach x lst (add_list x)) (end_list) lst ) (if (and (setq dcl (vl-filename-mktemp nil nil ".dcl")) (setq des (open dcl "w")) (write-line (strcat "filtlistbox : dialog { label = "" msg ""; spacer;" ": list_box { key = "lst"; width = 50; fixed_width = true; height = 15; fixed_height = true; allow_accept = true; " "multiple_select = " (if mtp "true" "false") "; }" ": edit_box { key = "flt"; width = 50; fixed_width = true; label = "Filter:"; }" "spacer; ok_cancel; }" ) des ) (not (close des)) (< 0 (setq dch (load_dialog dcl))) (new_dialog "filtlistbox" dch) ) (progn (_addlist "lst" (setq tmp lst)) (set_tile "lst" (setq rtn "0")) (set_tile "flt" "*") (action_tile "lst" "(setq rtn $value)") (action_tile "flt" (vl-prin1-to-string '(progn (setq flt (strcat "*" (strcase $value) "*")) (_addlist "lst" (setq tmp (vl-remove-if-not '(lambda ( x ) (wcmatch (strcase x) flt)) lst))) (set_tile "lst" (if (< (atoi rtn) (length tmp)) rtn (setq rtn "0"))) ) ) ) (setq rtn (if (= 1 (start_dialog)) (mapcar '(lambda ( x ) (nth x tmp)) (read (strcat "(" rtn ")"))) ) ) ) ) (if (< 0 dch) (setq dch (unload_dialog dch)) ) (if (and (= 'str (type dcl)) (findfile dcl)) (vl-file-delete dcl) ) rtn)
This is the other code I use, it will PLOT every selected layout from the listbox, specified from the layoutslist.
I always output PDF files and the goal is to quickly concatenate them using PUBLISH and I'm trying to skip any prompts for specifying directories.
Usually I name my layouts with prefix of "A4_L" or "A3_P" or "A2_L" ... "A0_P" then I try to concatenate those with the same prefix and orientation. So I end up with few multipage PDFs containing pages of the same size and orientation (to be plotted easily). |