TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: ELOQUINTET on January 16, 2007, 12:59:33 PM

Title: Plottabs help
Post by: ELOQUINTET on January 16, 2007, 12:59:33 PM
CAB or whoever else migh tbe able to help. I am trying to setup a plottabs which has several settings hard coded. Basically when I send out a set of drawings for submission I need 5 different plot settings listed below. I have created 5 different plottabs for each setup and would like to be able to click a button and it would plot everything collated at once. I figured out how to change the page setup but the order and quantity are driving me nuts. i cannot get a quantity other than 1 and the reverse box checked. i am also wondering if i can even run everything from a macro. can anyone help me out?

Plot#1
Page setup:510
Reverse order: Yes
Number of sets:5

Plot#2
Page setup:500
Reverse order: No
Number of sets:1

Plot#3
Page setup:800
Reverse order: No
Number of sets:1

Plot#4
Page setup:Small copy
Reverse order: No
Number of sets:3

Plot#5
Page setup:1117
Reverse order: No
Number of sets:1



Title: Re: Plottabs help
Post by: ELOQUINTET on January 16, 2007, 01:32:21 PM
mmmm one thing i forgot this won't work for me because plottabs doesn't work across mutliple drawings. my submission consists almost always of 5 or more dwgs  :cry:
Title: Re: Plottabs help
Post by: CAB on January 16, 2007, 01:37:36 PM
Dan I moved the thread.
I off to lunch but I'll look at the problem when I return.

PS Are the DWG's one layout per DWG? Just curious.
Title: Re: Plottabs help
Post by: CAB on January 16, 2007, 01:42:55 PM
Perhaps you could explaining exactly how the sheets & sets are plotted. EXACTLY which dwg & witch layout & which plot setting & how many copies.
How are they collated?
Title: Re: Plottabs help
Post by: ELOQUINTET on January 16, 2007, 02:44:17 PM
Cab we usually have multiple tabs per drawing and the complete set usually consists of:

1) Location plan(s)

2) Excel Schedule and/or elevations (Elevations are done in a seperate drawing then xrefffed in except for on bigger jobs that have an entire page of elevations)

3) Details

4) Wiring (we have a notes page and if the schematic is small enough it is xreffed into notes page except for on bigger jobs that have an entire page of schematics)

When we submit a job we have to send
5 sets to our bond printer reverse order
3 8 x 11 copies for our records
1 set of Vellum for flat file
1 set of Vellum for architect (i send vellum sets to 2 different printers because they are slow)
1 11 x 17 set for project manager

The number of tabs per file and total files really depends on the size of the job but this is basically it. Does that make more sense now? Thanks
Title: Re: Plottabs help
Post by: CAB on January 16, 2007, 03:36:58 PM
No not really.
As I have no knowledge of your system I need more detail as to how you want things to work.
This is what I need:

Code: [Select]
<drawing1> send as <plot: 510> <reverse order: Yes> <5 sets>
<drawing1> send as <plot: 500> <reverse order: No> <1 sets>
<drawing1> send as <plot: 800> <reverse order: No> <1 sets>
<drawing1> send as <plot: Small copy> <reverse order: No> <1 sets>
<drawing1> send as <plot: 1117> <reverse order: No> <1 sets>

<drawing2> send as <plot: 510> <reverse order: Yes> <5 sets>
<drawing2> send as <plot: 500> <reverse order: No> <1 sets>
<drawing2> send as <plot: 800> <reverse order: No> <1 sets>
<drawing2> send as <plot: Small copy> <reverse order: No> <1 sets>
<drawing2> send as <plot: 1117> <reverse order: No> <1 sets>

<drawing3> send as <plot: 510> <reverse order: Yes> <5 sets>
<drawing3> send as <plot: 500> <reverse order: No> <1 sets>
<drawing3> send as <plot: 800> <reverse order: No> <1 sets>
<drawing3> send as <plot: Small copy> <reverse order: No> <1 sets>
<drawing3> send as <plot: 1117> <reverse order: No> <1 sets>

Or should it be like this:

Code: [Select]
<drawing1> send as <plot: 510> <reverse order: Yes> <5 sets>
<drawing2> send as <plot: 510> <reverse order: Yes> <5 sets>
<drawing3> send as <plot: 510> <reverse order: Yes> <5 sets>

<drawing1> send as <plot: 800> <reverse order: No> <1 sets>
<drawing2> send as <plot: 800> <reverse order: No> <1 sets>
<drawing3> send as <plot: 800> <reverse order: No> <1 sets>

<drawing1> send as <plot: Small copy> <reverse order: No> <1 sets>
<drawing2> send as <plot: Small copy> <reverse order: No> <1 sets>
<drawing3> send as <plot: Small copy> <reverse order: No> <1 sets>

<drawing1> send as <plot: 1117> <reverse order: No> <1 sets>
<drawing2> send as <plot: 1117> <reverse order: No> <1 sets>
<drawing3> send as <plot: 1117> <reverse order: No> <1 sets>
Title: Re: Plottabs help
Post by: ELOQUINTET on January 16, 2007, 04:06:12 PM
well it would seem logical to group the to each printer together but as they are 5 standalone printers they could be sent either way as long as each comes out collated i don't care in what order they are processed. I mean it may make the most sense to send the 500 and 800 prints first as they take the longest to print but other than that it doesn't matter, am i understanding you cab? you have the basic idea in sceme #2 below except it is missing the 500 plot and small copy requires 3 sets. You have an idea of how i might achieve this?
Title: Re: Plottabs help
Post by: CAB on January 16, 2007, 09:48:29 PM
Ran into a snag trying to use ObjectDBX.
This would not work (vla-get-Plot dbxdoc)

Unless someone has a way around that I am afraid you will have to use a script.

Put something like this in a script:

Code: [Select]
open <dwgName>
(or sub_plottabs (load "PlotTabs.lsp"))
(foreach ps  '(("500" nil 1) ("510" t 5) ("800" nil 1) ("Small copy" nil 3) ("1117" nil 1))                                                                             
          (sub_plottabs                                                                                   
              ;;  Option variables passed to this routine in this order                                   
              (list                                                                                       
                (car ps)  ;  plot-config    Config Name if plot, default to "Current"                     
                (nth 2 ps);  plot-qty       number of copies of each sheet                               
                "Tab"     ;  plot-order     Sort order of tabs "Alpha" "Numeric" "Tab" order             
                (cadr ps) ;  revorder       t/nil Reverse the order of plots                             
                nil       ;  savelayout     Always set to True- Not an option in this version             
                t         ;  collatesets    t/nil  Collate plan sets when more than one plotted           
                t         ;  excludetab     t/nil  Flag to exclude tabs with flag character               
                "~"       ;  excludechr     "~"  Character marker for exclude tabs                       
                nil       ;  zoom-all       t/nil  Zoom layout before plotting                           
                nil       ;  PlotToFile     t/nil                                                         
                t         ;  PlotAllTabs    Ignore the Pick List of Tabs                                 
                T         ;  setlaystate    ACAD>2000 set layer state by name of tab before plotting     
                ""        ;  MyPath         Path for 'Plot To File'                                       
                "*"       ;  Tabs2Plot      List of tab names  ("Sheet 1" "Sheet 2" "Sheet*") wild card ok
             )                                                                                           
          ) ; end sub_plottabs                                                                           
                                                                                                         
) ; end foreach PSlist

close   


If you decide to try the script let me know & I'll send you an updated PlotTabs.lsp as the old one will not work with this.
Title: Re: Plottabs help
Post by: T.Willey on January 17, 2007, 11:35:02 AM
Ran into a snag trying to use ObjectDBX.
This would not work (vla-get-Plot dbxdoc)

Unless someone has a way around that I am afraid you will have to use a script.
I was never able to use ObjectDBX for plotting.  Maybe if you have the full version of ReadDwg, then you could print it without opening it in an editor.  Haven't tried it with anyother languages thatn lisp though, so maybe it would work with .Net or Arx.
Title: Re: Plottabs help
Post by: CAB on January 17, 2007, 12:59:48 PM
Thanks Tim for confirming my suspicions.

PS what is ReadDWG?
Title: Re: Plottabs help
Post by: T.Willey on January 17, 2007, 01:01:26 PM
RealDwg is the new ObjectDBX.  The full version is something you have to pay for, and it gives you full access to drawings, so you might be able to print fromt here (I think you can).
Title: Re: Plottabs help
Post by: CAB on January 17, 2007, 01:22:24 PM
Thanks again. :-)
Title: Re: Plottabs help
Post by: ELOQUINTET on January 17, 2007, 01:24:33 PM
sorry guys for not chiming in sooner. i'm actually working from home today (a little under the weather). i will have to try the script route tomorrow when i'm back at work. thanks for helping me out with this as it's been urking me for some time
Title: Re: Plottabs help
Post by: CAB on January 17, 2007, 01:59:01 PM
Dan,
Make sure you are using version 2.14, get it here
http://www.theswamp.org/index.php?topic=1916.msg24899#msg24899
Title: Re: Plottabs help
Post by: ELOQUINTET on January 18, 2007, 11:10:28 AM
Cab,

I brought the script into Hurricane and am trying to run it but am getting an error message that reads:

Error in plot options
Bad plot config name

I put the page setups in there but should it be the printer names, what is plot config name?
Here's my script:

 
Code: [Select]
; ***************************************************************
;  HURRICANE 6.5.13 - SCRIPT CREATED 1/18/2007 : 11:02:32 AM
; ***************************************************************
_OPEN
"d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
; << START OF PRE-USERSCRIPT COMMANDS >>
(SETVAR "MODEMACRO" "Drawing 1 of 2")
; << START OF USER SCRIPT >>
(or sub_plottabs (load "PlotTabs.lsp"))
(foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))                                                                             
          (sub_plottabs                                                                                   
              ;;  Option variables passed to this routine in this order                                   
              (list                                                                                       
                (car ps)  ;  plot-config    Config Name if plot, default to "Current"                     
                (nth 2 ps);  plot-qty       number of copies of each sheet                               
                "Tab"     ;  plot-order     Sort order of tabs "Alpha" "Numeric" "Tab" order             
                (cadr ps) ;  revorder       t/nil Reverse the order of plots                             
                nil       ;  savelayout     Always set to True- Not an option in this version             
                t         ;  collatesets    t/nil  Collate plan sets when more than one plotted           
                t         ;  excludetab     t/nil  Flag to exclude tabs with flag character               
                "~"       ;  excludechr     "~"  Character marker for exclude tabs                       
                nil       ;  zoom-all       t/nil  Zoom layout before plotting                           
                nil       ;  PlotToFile     t/nil                                                         
                t         ;  PlotAllTabs    Ignore the Pick List of Tabs                                 
                T         ;  setlaystate    ACAD>2000 set layer state by name of tab before plotting     
                ""        ;  MyPath         Path for 'Plot To File'                                       
                "*"       ;  Tabs2Plot      List of tab names  ("Sheet 1" "Sheet 2" "Sheet*") wild card ok
             )                                                                                           
          ) ; end sub_plottabs                                                                           
                                                                                                         
) ; end foreach PSlist

close
_QSAVE
; << END OF USER SCRIPT >>
; << START OF POST-USERSCRIPT COMMANDS >>
qsave
; << END OF POST-USERSCRIPT COMMANDS >>
_OPEN
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
; << START OF PRE-USERSCRIPT COMMANDS >>
(SETVAR "MODEMACRO" "Drawing 2 of 2")
; << START OF USER SCRIPT >>
(or sub_plottabs (load "PlotTabs.lsp"))
(foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))                                                                             
          (sub_plottabs                                                                                   
              ;;  Option variables passed to this routine in this order                                   
              (list                                                                                       
                (car ps)  ;  plot-config    Config Name if plot, default to "Current"                     
                (nth 2 ps);  plot-qty       number of copies of each sheet                               
                "Tab"     ;  plot-order     Sort order of tabs "Alpha" "Numeric" "Tab" order             
                (cadr ps) ;  revorder       t/nil Reverse the order of plots                             
                nil       ;  savelayout     Always set to True- Not an option in this version             
                t         ;  collatesets    t/nil  Collate plan sets when more than one plotted           
                t         ;  excludetab     t/nil  Flag to exclude tabs with flag character               
                "~"       ;  excludechr     "~"  Character marker for exclude tabs                       
                nil       ;  zoom-all       t/nil  Zoom layout before plotting                           
                nil       ;  PlotToFile     t/nil                                                         
                t         ;  PlotAllTabs    Ignore the Pick List of Tabs                                 
                T         ;  setlaystate    ACAD>2000 set layer state by name of tab before plotting     
                ""        ;  MyPath         Path for 'Plot To File'                                       
                "*"       ;  Tabs2Plot      List of tab names  ("Sheet 1" "Sheet 2" "Sheet*") wild card ok
             )                                                                                           
          ) ; end sub_plottabs                                                                           
                                                                                                         
) ; end foreach PSlist

close
_QSAVE
; << END OF USER SCRIPT >>
; << START OF POST-USERSCRIPT COMMANDS >>
qsave
; << END OF POST-USERSCRIPT COMMANDS >>
Title: Re: Plottabs help
Post by: CAB on January 18, 2007, 11:50:43 AM
That is the "Page Setup name"
So it is not in the drawing or the name is not matching, perhaps a case sensitive issue in the name.
Title: Re: Plottabs help
Post by: CAB on January 18, 2007, 12:12:04 PM
Try this: At line 167 replace the cond statment with this:
Code: [Select]
      (cond
        ((not (member (strcase plot-config) (mapcar 'strcase config-list)))
         (setq err_str "Bad plot config name.")
        )
        ((not (member plot-order '("Alpha" "Numeric" "Tab")))
         (setq err_str "Bad plot order name, case sensitive.")
        )
      ) ; end cond
Title: Re: Plottabs help
Post by: ELOQUINTET on January 18, 2007, 12:51:03 PM
ok cab i discovered one of the page setups had a problem with caps so i fixed that and replaced to cond in the code. when i run it now i don't get an error message but help pops up at the end and nothing prints. any recommendations?
Title: Re: Plottabs help
Post by: CAB on January 18, 2007, 01:14:02 PM
Let me run some test here and I'll get back to you.

What HELP pops up, the PlotTabs Help?
Title: Re: Plottabs help
Post by: ELOQUINTET on January 18, 2007, 01:49:19 PM
no autocad help pops up to the main page. i can see it processing at the command line but it's too fast to read what's happening and when i open the text window i don't see any of the script so not sure what's going on. thanks for looking into this because it would really be great not only for me but others if plottabs could be used on multiple drawings. i really appreciate all that you do for me. so what do you want for christmas this year?
Title: Re: Plottabs help
Post by: CAB on January 18, 2007, 08:04:26 PM
Christmas? Why ACAD2007  8-)

Try the attached file.
Title: Re: Plottabs help
Post by: CAB on January 18, 2007, 08:21:15 PM
I don't know it this would be any easier, but you could create a helper lisp like this:

Code: [Select]
(defun PlotHelper (Setups)
 (foreach ps Setups
  (sub_plottabs
      ;;  Option variables passed to this routine in this order
      (list
        (car ps)  ;  plot-config    Config Name if plot, default to "Current"
        (nth 2 ps);  plot-qty       number of copies of each sheet
        "Tab"     ;  plot-order     Sort order of tabs "Alpha" "Numeric" "Tab" order
        (cadr ps) ;  revorder       t/nil Reverse the order of plots
        nil       ;  savelayout     Always set to True- Not an option in this version
        t         ;  collatesets    t/nil  Collate plan sets when more than one plotted
        t         ;  excludetab     t/nil  Flag to exclude tabs with flag character
        "~"       ;  excludechr     "~"  Character marker for exclude tabs
        nil       ;  zoom-all       t/nil  Zoom layout before plotting
        nil       ;  PlotToFile     t/nil 
        t         ;  PlotAllTabs    Ignore the Pick List of Tabs
        T         ;  setlaystate    ACAD>2000 set layer state by name of tab before plotting
        ""        ;  MyPath         Path for 'Plot To File'
        "*"       ;  Tabs2Plot      List of tab names  ("Sheet 1" "Sheet 2" "Sheet*") wild card ok
     )
  ) ; end sub_plottabs
 ) ; end foreach
)

Then use this as your script.

Code: [Select]
OPEN
 "d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
(if (and (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
            (or PlotHelper   (/= (load "plotHelper.lsp" "fail") "fail")))
  (PlotHelper '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1)))
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y

Open
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
(if (and (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
            (or PlotHelper   (/= (load "plotHelper.lsp" "fail") "fail")))
  (PlotHelper '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1)))
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y


OR just remove the comments in the batch like this:

Code: [Select]
OPEN
 "d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))                                                                             
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y

Open
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))                                                                             
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
Title: Re: Plottabs help
Post by: ELOQUINTET on January 18, 2007, 09:05:45 PM
ok i will have to try these out tomorrow and let you know how it goes. i need to play around with the options in hurricane to get the results i want as well. thanks i'll give it a try.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 19, 2007, 09:26:47 AM
cab i downloaded the updated lisp and created the plothelper and modified my script. when the program creates the batch script it put the open and whatever drawings i specify it to run the script on into the batch script so i just put the body as my initial script like below. when i run any of the variations nothing happens at all  :cry: not sure what is going on

Code: [Select]
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))                                                                             
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
Title: Re: Plottabs help
Post by: CAB on January 19, 2007, 09:44:12 AM
Create a script file with this & it will not close the opened file. Then you can look at the command line output to see what happened
Code: [Select]
OPEN
 "d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
<<close>>
<<Y>>

PS  I'll be back in 2-3 hours, post your command line ouput & I'll fix it.  :-)
Title: Re: Plottabs help
Post by: ELOQUINTET on January 19, 2007, 10:41:45 AM
cab here's what i got at the command line. i see it has something to do with the plot to file path and i was trying to mess around with it but had no luck.


Code: [Select]
Enter name of drawing to open <.>: "d:\Drawings\M-2630EM ONE CHRISTINA
CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"

Opening an AutoCAD 2004 format file.
Regenerating layout.
Regenerating model.

AutoCAD Express Tools Copyright © 2002-2004 Autodesk, Inc.

AutoCAD menu utilities loaded.
AutoCAD menu utilities loaded.
Command: (SETVAR "MODEMACRO" "Drawing 1 of 2")
"Drawing 1 of 2"

Command: (if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
(_>   (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5)
("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
((_>     (setq *ptdebug* t)
((_>     (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~"
nil nil t T "" "*"))
((_>   )
(_>   (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
(_> )
Plot Tabs is loaded, Enter PLotTabs to run.
PlotTabs011407 running.
* * * *    S t a r t i n g   t h e   P l o t     * * * *
* * * *    Debug Mode is ON     * * * *
=-=-=-=-=-=-=-=-=-=   DEBUG MODE =-=-=-=-=-=-=-=-=-=-=
  * * * *    Variable Dump     * * * *
-> d-prot-500ps [Plot-Config]- Name if plot, default to Current
-> 1 [Plot-QTY]- number of copies of each sheet
-> Tab [Plot-order]- Sort order of tabs "Alpha" "Numeric" "Tab" order
-> False [RevOrder]- t/nil Reverse the order of plots
-> True [PlotAllTabs]- t/nil Plot All tabs or use picks
-> True [setlaystate]- t/nil set layer state per tab name
-> False [PlotToFile]- Flag
->  [MyPath]- Path for 'Plot To File'; error: bad argument type: fixnump: nil

Command: <<close>>
Unknown command "<<CLOSE>>".  Press F1 for help.
Title: Re: Plottabs help
Post by: CAB on January 19, 2007, 01:29:43 PM
One more time. :)
Title: Re: Plottabs help
Post by: ELOQUINTET on January 19, 2007, 04:49:43 PM
hey cab it printed the first drawing collated to all printers as anticipated but what it didn't do was print the second drawing to any printers. this is a powerful tool as is but it would be super if it printed multiple drawings because like i said our drawing sets can utilize 5 or more dwgs. i just want to know if it is intended to do so and if i just need to play with some settings maybe in hurricane. thanks you're the best

Code: [Select]
; ***************************************************************
;  HURRICANE 6.5.13 - SCRIPT CREATED 1/19/2007 : 4:28:02 PM
; ***************************************************************
_OPEN
"d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
; << START OF PRE-USERSCRIPT COMMANDS >>
(SETVAR "MODEMACRO" "Drawing 1 of 2")
; << START OF USER SCRIPT >>
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
_QSAVE
_OPEN
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
; << START OF PRE-USERSCRIPT COMMANDS >>
(SETVAR "MODEMACRO" "Drawing 2 of 2")
; << START OF USER SCRIPT >>
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
_QSAVE
Title: Re: Plottabs help
Post by: CAB on January 19, 2007, 05:05:36 PM
dan,
This should work, It does on my end.
You have added the QSAVE after the drawing is already closed. I did not use QSAVE as it caused problems with
ACAD2000 which I am testing with. I saw no reason to save the drawings as you are not modifying them.
So try to remove the QSAVE & see it it works.

Code: [Select]
; ***************************************************************
;  HURRICANE 6.5.13 - SCRIPT CREATED 1/19/2007 : 4:28:02 PM
; ***************************************************************
_OPEN
"d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
; << START OF PRE-USERSCRIPT COMMANDS >>
(SETVAR "MODEMACRO" "Drawing 1 of 2")
; << START OF USER SCRIPT >>
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
[color=red]_QSAVE   <----<<<[/color]
_OPEN
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
; << START OF PRE-USERSCRIPT COMMANDS >>
(SETVAR "MODEMACRO" "Drawing 2 of 2")
; << START OF USER SCRIPT >>
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
[color=red]_QSAVE  <---<<<[/color]
Title: Re: Plottabs help
Post by: ELOQUINTET on January 19, 2007, 05:33:52 PM
that's what i thought. my script ends exactly like yours
close
y
but once i produce the batch script it keeps putting the qsave in there. i have been looking at the settings and there are some save options but i do not have it set to save. hmmm how annoying
Title: Re: Plottabs help
Post by: ELOQUINTET on January 22, 2007, 10:14:25 AM
hey cab so you said you were able to get it to work, what batch processor are you using if any? i have looked and looked and discovered that if i check the test run option and create the script the qsaves aren't there but when i run it it has the same results only one drawing is processed. i have posted my questions on their forum but it's not real active so... I just wondered how you got it to work on your end? thanks
Title: Re: Plottabs help
Post by: CAB on January 22, 2007, 04:03:20 PM
I just pasted the code in a text file saved as scr. Then typed script at the command prompt.
If all you need is a front end to pick the dwg files to run the scrit on you can use the routine
by Tim Willey.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 23, 2007, 10:15:59 AM
CAB,
When you say the routine by Tim Willey do you mean the RealDwg he referred to earlier in this post or something else he wrote? I've been talking to the batch script guy and can't get his program to open the second drawing but i'm curious as to why it's not working more than anything. I looked at RealDwg but it costs money :| is there a free version or something? A little confused...
Title: Re: Plottabs help
Post by: CAB on January 23, 2007, 10:24:30 AM
No Tim wrote a lisp to create script files. If Tim doesn't mind I'll post a modified version here.
The limitation i see in this lisp is the ability to pick dwg files from differant folders. it is designed to process all dwg files found in the user picked folder. It can be changed to allow picking specific files in one folder but picking files from more than one folder requires more programing. At present I don't have a routine to do that.

Please post you current script file so I can See if I can determine why it's stopping.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 23, 2007, 10:41:17 AM
ok cab i tried your approach by creating the batch script via hurricane then pasted that into a text file and running it from autocad. again it printed the first file but didn't open the second. :cry: i posted the script below for you to review. i'd appreciate Tim's routine and thank Tim for writing and sharing it with us :-)

_OPEN
"d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
_OPEN
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))
    (setq *ptdebug* t)                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
  (princ "\nCould not load PlotTabs.lsp or plotHelper.lsp")
)
close
Y
Title: Re: Plottabs help
Post by: CAB on January 23, 2007, 10:53:46 AM
First thing to do is to reverse the file order & see if the "d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
will print. Some times it's not the exit of the previous drawing but the failure of the next drawing.


I'm thinking you may need to replace the "Y" after CLOSE with this:
Code: [Select]
(If (or (> (logand 1 (getvar "CmdActive")) 0)
        (> (logand 2 (getvar "CmdActive")) 0))
  (command "Y"))
 
Reason being that if there was no change in the drawing the prompt to "Abandon Changes" does not happen.
I haven't tested this yet, just looking for a reason it quit on the first drawing.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 23, 2007, 11:22:26 AM
cab the logic makes sense but it still did not print the second batch of drawings. i may be getting ahead of myself a little but it's somewhat relevent now too. is it easy to modify the code to only print to a couple printers for now (i.e. small copy and 800) until we get it working because i'm running around like a madman trying to cancel everything when it doesn't work. one of the printers is not even in the same area of the building as i am so i'm sure drawings are piling up by project management with all this testing i'm doing  :-o.
Title: Re: Plottabs help
Post by: CAB on January 23, 2007, 12:01:57 PM
Change this
Code: [Select]
  (foreach ps  '(("d-prot-500ps" nil 1) ("d-prot Xerox510" t 5) ("d-prot-800" nil 1) ("small_copy" nil 3) ("HP LASER 11x17" nil 1))   to this
 
Code: [Select]
  (foreach ps  '( ("d-prot-800" nil 1) ("small_copy" nil 3))


For my test I just use this:
Code: [Select]
(foreach ps  '(("Adobe Arch D" nil 1)("Adobe Arch E1" nil 1))which just creates a pdf file, no printer involved.
Title: Re: Plottabs help
Post by: T.Willey on January 23, 2007, 07:42:43 PM
Sorry wasn't at work today, so I haven't checked the site.  Alan you can post the changes to the BScript program I wrote all you want.  It's fine with me.
Title: Re: Plottabs help
Post by: CAB on January 23, 2007, 07:53:43 PM
Thanks Tim.

Do you have a lisp for user pick of files from multiple folders?
Title: Re: Plottabs help
Post by: CAB on January 23, 2007, 11:47:32 PM
Dan,
Give this a try.
Code: [Select]
_OPEN
"d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-800" nil 1) ("small_copy" nil 3))                                                                           
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
)
qsave
close
_OPEN
"d:\Drawings\M-2464EM\M-2464EF\umdnj elevations.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-800" nil 1) ("small_copy" nil 3))                                                                       
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
)
qsave
close
Title: Re: Plottabs help
Post by: ELOQUINTET on January 24, 2007, 09:04:07 AM
cab sigh it still only printed the first drawing  :cry:
Title: Re: Plottabs help
Post by: CAB on January 24, 2007, 09:31:33 AM
Boy this is frustrating!
Use this in the script, when it stops, post the command line history.
Perhaps it will give a clue.
Code: [Select]
_OPEN
"d:\Drawings\M-2630EM ONE CHRISTINA CRESCENT\COMPLETE SUBMISSION\DETAILS.dwg"
(if (or sub_plottabs (/= (load "plottabs.lsp" "fail") "fail"))
  (foreach ps  '(("d-prot-800" nil 1) ("small_copy" nil 3))                                                                           
    (setq *ptdebug* t)
    (sub_plottabs (list  (car ps)  (nth 2 ps) "Tab" (cadr ps) nil t t "~" nil nil t T "" "*"))                                                                         
  )
)
Title: Re: Plottabs help
Post by: T.Willey on January 24, 2007, 11:01:59 AM
Thanks Tim.

Do you have a lisp for user pick of files from multiple folders?

Not really, but one could be written.  I would select the directory, then select the files to process from said directory, then add them to a list (path and name).  Then open up the directory select again, if cancel start the comamnd, if not do the same thing as above, repeat until cancel is hit.
Title: Re: Plottabs help
Post by: CAB on January 24, 2007, 11:15:26 AM
Yes, that was my thought too & perhaps a DCL picklist to display the selected files with a delete button to remove any unwanted files.
Too busy at the moment though.
Title: Re: Plottabs help
Post by: T.Willey on January 24, 2007, 11:19:31 AM
Yes, that was my thought too & perhaps a DCL picklist to display the selected files with a delete button to remove any unwanted files.
Too busy at the moment though.
If I have some time then, maybe I can roll one out.
Title: Re: Plottabs help
Post by: T.Willey on January 24, 2007, 12:15:35 PM
Here is a quick one.  I have work to do, so I don't know if I will be able to play later.  Its real simple.  It will return a list of all the drawings selected.  It won't check to see if the drawing is already there, and no way to remove any.  Attached is my dialog boxes that one of the functions use.  Here is how to use it
Code: [Select]
(setq listDwg (SelectMultiple))
Code: [Select]
(defun SelectMultiple (/ DirPath listDwg DiaRtn listFinal)

(while (setq DirPath (Directory-dia ""))
 (if
  (and
   (setq listDwg (vl-directory-files DirPath "*.dwg" 1))
   (setq DiaRtn (MultiSelect listDwg "Select all." T))
  )
  (if (equal (car DiaRtn) T)
   (foreach dwg listDwg
    (setq listFinal (cons (strcat DirPath dwg) listFinal))
   )
   (foreach num DiaRtn
    (setq listFinal (cons (strcat DirPath (nth num listDwg)) listFinal))
   )
  )
 )
)
listFinal
)
;---------------------------------------------------------------------------------------------------
(defun Directory-Dia ( Message / sh folder folderobject result)
;; By Tony Tanzillo
;; Modified by Tim Willey
;; 16 Will let you type in the path
;; 64 Will let you create a new folder

  (vl-load-com)
  (setq sh
     (vla-getInterfaceObject
        (vlax-get-acad-object)
        "Shell.Application"
     )
  )


  (setq folder
     (vlax-invoke-method
         sh
         'BrowseForFolder
         (vla-get-HWND (vlax-get-Acad-Object))
         Message
         0 ; This is the bit number to change.
      )
  )
  (vlax-release-object sh)


  (if folder
     (progn
        (setq folderobject
           (vlax-get-property folder 'Self)
        )
        (setq result
           (vlax-get-property FolderObject 'Path)
        )
        (vlax-release-object folder)
        (vlax-release-object FolderObject)
        (if (/= (substr result (strlen result)) "\\")
          (setq result (strcat result "\\"))
          result
        )
     )
  )
)
;--------------------------------------------------------------------
(defun MultiSelect (Listof Message Toggle / DiaLoad tmpStr tmpTog tmpList)

(setq DiaLoad (load_dialog "MyDialogs.dcl"))
(if (new_dialog "MultiSelect" DiaLOad)
 (progn
  (start_list "listbox" 3)
  (mapcar 'add_list Listof)
  (end_list)
  (if Message
   (set_tile "text1" Message)
  )
  (if (not Toggle)
   (mode_tile "toggle1" 1)
  )
  (mode_tile "listbox" 2)
  (action_tile "accept"
   "(progn
    (setq tmpStr (get_tile \"listbox\"))
    (if Toggle
     (setq tmpTog (get_tile \"toggle1\"))
    )
    (done_dialog 1)
   )"
  )
  (action_tile "cancel" "(done_dialog 0)")
  (if (= (start_dialog) 1)
   (progn
    (if tmpStr
     (setq tmpList (read (strcat "(" tmpStr ")")))
    )
    (if (= tmpTog "1")
     (cons T tmpList)
     tmpList
    )
   )
  )
 )
)
)
Title: Re: Plottabs help
Post by: CAB on January 24, 2007, 12:17:27 PM
Only if you have some spare time. Dan is in need at the moment but only if I can get this Script problem licked.
I would like to have a multi-file pick routine. It would be a neat tool. :-)
Title: Re: Plottabs help
Post by: CAB on January 24, 2007, 12:19:56 PM
That was quick. 8-)

I am having trouble with this in ACAD2000
Code: [Select]
(vla-get-HWND (vlax-get-Acad-Object))
No time here, I'll play with it this evening.
Title: Re: Plottabs help
Post by: T.Willey on January 24, 2007, 12:23:31 PM
That was quick. 8-)

I am having trouble with this in ACAD2000
Code: [Select]
(vla-get-HWND (vlax-get-Acad-Object))
No time here, I'll play with it this evening.
I think someone else had problems with it.  You can remove it.  What it does is if you have two monitor it will bring up the select directory box in the middle of the acad window.  Mine used to be in the middle of my two monitors, so that is why I added it.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 24, 2007, 12:24:57 PM
sorry guys i haven't been in here giving my input. i've been trying to complete a job this morning. cab it basically completes the first batch and says how many it is plotting and that's it there's no clues in the command box so i didn't post it. i will be busy this afternoon too so won't be able to test it much today. this is not a big rush by the way it would just be nice to have in the long run. yes i could see where a multi file selector could be used in alot of other routines. thanks guys for all your help i really appreciate it.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 24, 2007, 12:33:55 PM
i have another vba routine which will update an attribute in selected drawings and it uses the windows open dialogue box. i'm wondering if maybe you could call this vba routine a select the files you want to plot. i will look for it if this sounds like an option. i will be out of the office until 4 and will come back to check in on you guys.
Title: Re: Plottabs help
Post by: T.Willey on January 24, 2007, 12:54:33 PM
That was quick. 8-)

I am having trouble with this in ACAD2000
Code: [Select]
(vla-get-HWND (vlax-get-Acad-Object))
No time here, I'll play with it this evening.
Instead of removing the line all together, just change it to 0.  It should work then.
Title: Re: Plottabs help
Post by: ELOQUINTET on January 24, 2007, 05:27:51 PM
what i was getting at earlier was couldn't you call this routine and use the windows dialog box to select whatever files you want. the multiple folder selection would be a nice bonus but for me it's not required.

http://www.theswamp.org/lilly_pond/index.php?dir=dan/&file=CommonDialog.dvb