Jump to content

Recommended Posts

Posted

Hello all, long time no see :)

 

I'm having an issue with the first bit of this code in bold. I've added in the option to our plot LISP for plotting multiple copies. However, I keep getting an error of "bad argument type: fixnump:".

 

I'm wanting the copy amount to be set to 1 by default, and if the user presses enter without typing a number it will only print 1 copy.

 

(defun Laser5500 (/ myPLOLayoutList mylayout)
 (setq totcopy 1)
 [b](setq totalcopy
   (cond
     (
       (eq ""
         (setq totalcopy
           (getint
             (strcat "\nHow many copies to be printed <1>: "
             )
           )
         )
       )
       totcopy
     )
     ( totalcopy )
   )
 )  [/b]
     (EXPLO_db1_Main)
     (setvar "cmdecho" 0)
     (setq imagef (getvar "imageframe"))
     (setvar "imageframe" 2)
     (command "wipeout" "frames" "off")
   (setq mylayout (length myPLOLayoutList))
 (repeat totalcopy
     (if myPLOLayoutList                        
       (progn                            
       (setq                            ; Begin setq for myLayout
           myLayout (getvar "CTAB"))            ; End setq for myLayout
       (foreach myLayout (reverse myPLOLayoutList)
         (command "-plot"                    ; Command: -plot
           "Y"                         ; Detailed plot configuration? [Yes/No]
           mylayout                    ; Layout Name
           "NP2-HPCLJ5500.pc3"                ; Output Device Name
           "11x17"                        ; Paper Size
           "Inches"                    ; Paper Units
           "Landscape"                    ; Drawing Orientation [Portrait/Landscape]
           "No"                        ; Plot Upside Down? [Yes/No]
           "Extents"                    ; Plot Area [Display/Extents/Limits/View/Window]
           "1=1"                        ; Plot Scale (Plotted Inches=Drawing Units) or [Fit]
           "Center"                    ; Plot Offset (x,y) or [Center] <Center>
           "Yes"                        ; Plot Styles? [Yes/No]
           "monochrome.ctb"                ; Plot Style Table Name or [?] (enter . for none)
           "Yes"                        ; Plot Lineweights [Yes/No]
           "No"                        ; Scale Lineweights [Yes/No]
           "No"                        ; Plot Paper Space First? [Yes/No]
           "No"                        ; Hide Paperspace Objects? [Yes/No]
           "No"                        ; Plot to a File [Yes/No]
           "No"                        ; Save Changes to Page Setup [Yes/No]
           "Yes")                        ; Proceed With Plot [Yes/No]
        )))
   )
   (setvar "imageframe" imagef)
     (setvar "cmdecho" 1)
       (princ "\n ---------------------------------------------")
      (princ (strcat "\n ------ Express Plotting - Version " PLOVerNum " ------"))
     (princ "\n ---------------------------------------------")
     (princ)
)

Posted

Firstly, to understand the error message that you are receiving see here and see if you can tell me which part of the code crashed. ;)

 

Now, to understand why you are receiving that error message, note that getint will return nil if the user presses Enter, not an empty string. Take a look at this tutorial, specifically the last example.

Posted

Thanks Lee. Your tutorial helped. I was, obviously, missing the ITOA and a couple other things out of place.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...