Author Topic: Help - Print Lisp  (Read 2909 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Swamp Rat
  • Posts: 502
Help - Print Lisp
« 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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Help - Print Lisp
« Reply #1 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"
)
« Last Edit: April 21, 2006, 09:54:19 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Help - Print Lisp
« Reply #2 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)
)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Help - Print Lisp
« Reply #3 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
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Help - Print Lisp
« Reply #4 on: April 21, 2006, 10:44:54 AM »
It may not be the parentheses but the space after letter.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Help - Print Lisp
« Reply #5 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 ;=)
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Help - Print Lisp
« Reply #6 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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Help - Print Lisp
« Reply #7 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.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Help - Print Lisp
« Reply #8 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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Help - Print Lisp
« Reply #9 on: April 21, 2006, 11:23:31 AM »
try this in your code

"LETTER (8.5\" X 11\")"
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Help - Print Lisp
« Reply #10 on: April 21, 2006, 11:38:17 AM »
THAT DID IT

Kerry you rule

Thanks a bunch

Now get some sleep