Jump to content
Sambuddy

PUBLISH - 1st Page BLANK

Recommended Posts

Sambuddy

hey guys,

I am hoping someone can tell me what is wrong with my cad. I have been fiddling around with the autopublish to generate PDF and it seems somehow a variable or something was made incorrect. As a result, each time I publish say PDF or hard copy, first page/ tab of any project appears blank. This seems to be consistant no matter if I change my page setup under publish to any predefined setting.

(1st. page is always either blank or extremely small that appears as though it is blank). Any suggestions?

 

Does anyone know what is wrong?

 

Thanks

Share this post


Link to post
Share on other sites
BIGAL

Do you have Model as the 1st page followed by layouts, that would make sense. By the time I work out whats wrong I just use a plot range lisp and all done.

Share this post


Link to post
Share on other sites
rlx

I believe I've read something about not using extends for plot range but layouts. Haven't had this problem myself (not yet anyway)

Share this post


Link to post
Share on other sites
Sambuddy
14 hours ago, BIGAL said:

Do you have Model as the 1st page followed by layouts, that would make sense. By the time I work out whats wrong I just use a plot range lisp and all done.

No I would not include the model space when publishing. I noticed that "plot range lisp" that use "- plot" takes way more time than a simple publish. That is why I stopped working on one but then my problem arose.

 

1 hour ago, rlx said:

I believe I've read something about not using extends for plot range but layouts. Haven't had this problem myself (not yet anyway)

Everything seems fine in regards to "Plot Area". It is set to what always has. The funny thing is if I restart AutoCAD I can publish the first layout, but then during work if I attempt to publish the first page appears blank.

It is as though, through my experiments, I set a variable or something that I cannot find so maybe it redefines the first page to something other that what I selected???

I used these routines:

(defun c:SET-PG-LAY ( / col doc itm lst )
    (setq doc (vla-get-activedocument (vlax-get-acad-object))
          col (vla-get-plotconfigurations doc)
    )
    (cond
        (   (zerop (vla-get-count col))
            (princ "\nNo Page Setups found.")
        )
        (   (null
                (setq itm
                    (LM:listfort "Select Page Setup to Apply"
                        (progn
                            (vlax-for x col (setq lst (cons (vla-get-name x) lst)))
                            (acad_strlsort lst)
			    
                        )
                        0
                    )
                )
            )
            (princ "\n*Cancel*")
        )
        (   (setq itm (vla-item col (car itm)))
            (vlax-for x (vla-get-layouts doc)
                (if (/= "MODEL" (strcase (vla-get-name x)))
                    (vla-copyfrom x itm)
                )
            )
        )
    )
    (princ)
) ;END DEFUN

;; List Box  -  Lee Mac
;; Displays a DCL list box allowing the user to make a selection from the supplied data.
;; msg - [str] Dialog label
;; lst - [lst] List of strings to display
;; bit - [int] 1=allow multiple; 2=return indexes
;; Returns: [lst] List of selected items/indexes, else nil

(defun LM:listfort ( msg lst bit / dch des tmp rtn )
    (cond
        (   (not
                (and
                    (setq tmp (vl-filename-mktemp nil nil ".dcl"))
                    (setq des (open tmp "w"))
                    (write-line
                        (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select="
                            (if (= 1 (logand 1 bit)) "true" "false") ";width=36;height=52;}spacer;ok_cancel;}"
                        )
                        des
                    )
                    (not (close des))
                    (< 0 (setq dch (load_dialog tmp)))
                    (new_dialog "listbox" dch)
                )
            )
            (prompt "\nError Loading List Box Dialog.")
        )
        (   t     
            (start_list "list")
            (foreach itm lst (add_list itm))
            (end_list)
            (setq rtn (set_tile "list" "0"))
            (action_tile "list" "(setq rtn $value)")
            (setq rtn
                (if (= 1 (start_dialog))
                    (if (= 2 (logand 2 bit))
                        (read (strcat "(" rtn ")"))
                        (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))
                    )
                )
            )
        )
    )
    (if (< 0 dch)
        (unload_dialog dch)
    )
    (if (and tmp (setq tmp (findfile tmp)))
        (vl-file-delete tmp)
    )
    rtn
)

(vl-load-com) (princ)
(defun c:PUBLISH-LIST-LAYOUT-PLOT ( / 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)
) ;END DEDUN



;;------------------=={ 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
) ;END LM:FiltListBox

 

Share this post


Link to post
Share on other sites
Dana W

The code is looping once first time without any layout is my guess, based on 23 years of programing experience but I can't find it cuz I don't read LIPS (LOL)

Share this post


Link to post
Share on other sites
Sambuddy

Thanks guys for your input - I got so fed up that I abandoned that idea all together.

No worries

 

Thanks for your input though.

This forum is great! 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...