TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Biscuits on April 21, 2006, 09:21:48 AM

Title: Help - Print Lisp
Post by: Biscuits on April 21, 2006, 09:21:48 AM
This is part of an old print routine routine that was working great until we got a new printer with new drivers.
I need to replace "LETTER" with  "LETTER (8.5 x 11)".
Problem is that the parentheses mess up the routine. Any ideas?

Quote

     (SETQ PSIZ   "LETTER"
      PORT   "LANDSCAPE"
      PSTN   "MINE.CTB"
     )
Thanks
Title: Re: Help - Print Lisp
Post by: Kerry on April 21, 2006, 09:29:49 AM
Is this what you want ?

Code: [Select]
(SETQ PSIZ "LETTER (8.5 x 11)"
      PORT "LANDSCAPE"
      PSTN "MINE.CTB"
)
Title: Re: Help - Print Lisp
Post by: Biscuits on April 21, 2006, 10:24:40 AM
Doesn't work Kerry.

"letter" substitutes the established variable (PSIZ).
"LETTER (8.5 x 11)" is what the new printer driver now requires at the command line (not lisp), but if I put "LETTER (8.5 x 11)" into the routine, the additional parentheses messes up the routine.

Hope I'm making sense.

Quote
(DEFUN C:ZPLOT (/ LPGE NOFP OFRM PORT PRTR PSIZ PSTN STDP VNAM)
              ; DEFUN C:ZPLOT WITH VARIABLES FOR
              ; LPGE = LAST PAGE TO PLOT
              ; NOFP = NAME OF PRINTER
              ; OFRM = OUTPUT FORMAT
              ; PORT = PLOT ORIENTATION (LANDSCAPE OR
              ;        PORTRAIT)
              ; PRTR = PRINTER TO USE (BY AREA)
              ; PSIZ = PAPER SIZE (11X17 OR LETTER)
              ; PSTN = PLOT STYLE TABLE NAME
              ;        (LOZIER.CTB OR LOZIERII.CTB)
              ; STDP = STANDARD PLOT
              ; VNAM = VIEW NAME ( 1, 2, 3,.........20)
  (SETVAR "CMDECHO" 0)
  (INITGET "E T D")
  (SETQ   PRTR (GETKWORD (STRCAT "\nPlot to printer in "
                "Engineering/meTal/wooD. [E/T/D] "
                "<meTal>: "
             )
        )
  )              ; REQUEST PRINTER TO USE (PRTR)
  (COND
    ((EQUAL PRTR "E")
     (SETQ NOFP "MODFT2_HP5SI")
    )
    ((EQUAL PRTR "D")
     (SETQ NOFP "MODFT1_HP4V")
    )
    ((OR
       (NULL PRTR)
       (EQUAL PRTR "T")
     )
     (SETQ NOFP "MODFT1_HP5SI")
    )
  )
  (INITGET "V H B")
  (PRINC "\nChoose format for output: ")
  (SETQ
    OFRM (GETKWORD (STRCAT "\naVertical/aHorizontal/Bsize "
            "[V/H/B] <Bsize>: "
         )
    )
  )              ; REQUEST OUTPUT FORMAT (OFRM)
  (COND              ; BEGIN OUTPUT FORMAT TEST CONDITIONS
    ((EQUAL OFRM "V")        ; OFRM = AVERTICAL?
     (SETQ PSIZ   "LETTER)"
      PORT   "PORTRAIT"
      PSTN   "MINEII.CTB"
     )
    )
    ((EQUAL OFRM "H")        ; OFRM = AHORIZONTAL?
     (SETQ PSIZ   "LETTER)"
      PORT   "LANDSCAPE"
      PSTN   "MINEII.CTB"
     )
    )
    ((OR           ; OFRM = NULL OR BSIZE?
       (NULL OFRM)
       (EQUAL OFRM "B")
     )
     (SETQ PSIZ   "11X17"
      PORT   "LANDSCAPE"
      PSTN   "WOOD.CTB"
     )
    )
  )              ; END OUTPUT FORMAT TEST CONDITIONS
  (INITGET (+ 2 4))
  (SETQ VNAM (GETINT "\nEnter first View Name to plot <1>: "))
  (IF (NULL VNAM)
    (SETQ VNAM 1)
  )
  (INITGET (+ 2 4))
  (SETQ LPGE (GETINT "\nEnter last View Name to plot <1>: "))
  (IF (NULL LPGE)
    (SETQ LPGE 1)
  )
  (WHILE           ; BEGIN PLOT WHILE
    (<= VNAM LPGE)
     (COMMAND "-PLOT"  "YES"   "MODEL"    NOFP     PSIZ      "INCHES"
         PORT     "NO"   "VIEW"    VNAM     "FIT"      "CENTER"
         "YES"    PSTN   "YES"    "NO"     "NO"      "NO"
         "YES"
        )
     (SETQ VNAM (1+ VNAM))
  )              ; END PLOT WHILE
  (SETVAR "CMDECHO" 1)
  (PRINC "\nPlotting Complete. ")
  (PRINC)
)
Title: Re: Help - Print Lisp
Post by: Kerry on April 21, 2006, 10:34:42 AM
Can you do a plot completely at the command line and post back the command line text .. please
Title: Re: Help - Print Lisp
Post by: CAB on April 21, 2006, 10:44:54 AM
It may not be the parentheses but the space after letter.
Title: Re: Help - Print Lisp
Post by: Kerry on April 21, 2006, 10:58:45 AM
This is/maybe the problem


(SETQ PSIZ   "LETTER) "

You don't edit in the VLIDE, do you ;=)
Title: Re: Help - Print Lisp
Post by: Biscuits on April 21, 2006, 11:12:06 AM
I just found that Kerry. That was a result of poor editing. That wasn't the original cause the problem just a new one I've corrected. Original problem still exists.

I thank all of you for your help. I'm still stuck
Title: Re: Help - Print Lisp
Post by: Kerry on April 21, 2006, 11:17:11 AM
It's way past my bedtime, and I need my beauty sleep ...  so if you do post as noted in  Reply #3 I'm sure someone will attempt to help.
Title: Re: Help - Print Lisp
Post by: Biscuits on April 21, 2006, 11:21:02 AM
Here ya go

Quote
-plot
yes
model
MODFT1_HP5SI.PC3
LETTER (8.5" X 11")
inches
landscape
no
view
1
fit
0,0
yes
lozierii.ctb
yes
no
no
no
yes
Title: Re: Help - Print Lisp
Post by: Kerry on April 21, 2006, 11:23:31 AM
try this in your code

"LETTER (8.5\" X 11\")"
Title: Re: Help - Print Lisp
Post by: Biscuits on April 21, 2006, 11:38:17 AM
THAT DID IT

Kerry you rule

Thanks a bunch

Now get some sleep