what's wrong with my lisp?

Discussion in 'AutoCAD' started by VikCAD04, Oct 8, 2004.

  1. VikCAD04

    VikCAD04 Guest

    ; ISSUED FOR CONSTRUCTION STAMP
    (DEFUN C:IFC (/ CMD OSN LM LMX)
    (SETQ CMD (GETVAR "CMDECHO"))
    (SETQ OSN (GETVAR "OSMODE"))
    (SETVAR "OSMODE" 0)
    (SETVAR "CMDECHO" 0)
    (setq LM (GETVAR "LIMMAX")
    LMX (CADR LM))
    (initget "D I")
    (setq UI (getkword "\n Is this a Demolition (D) or Installation (I)?: "))
    (if (not UI)
    (setq UI "I"))

    (COMMAND ".layer" "n" "stamps" "C" "249" "stamps" "S" "stamps" "")
    ;IF D-SIZE THEN DO THIS

    (COND
    ((= LMX 22.0)
    (if (= UI "D")
    (COMMAND ".-insert" "IFCD-D" "0,0" "1" "" ""
    ".LAYER" "S" "0" ""))

    (if (= UI "I")
    (COMMAND ".-insert" "IFCI-D" "0,0" "1" "" ""
    ".LAYER" "S" "0" "")))

    ;IF E-SIZE THEN DO THIS
    ((= LMX 34.0)
    (IF (= UI "D")
    (COMMAND ".-insert" "IFCD-E" "0,0" "1" "" ""
    ".LAYER" "S" "0" ""))

    (IF (= UI "I")
    (COMMAND ".-insert" "IFCI-E" "0,0" "1" "" ""
    ".LAYER" "S" "0" ""))))


    (command ".draworder" "l" "" "b"
    ".draworder" (ssget "x" '((0 . "IMAGE"))) "" "b"
    ".layer" "lo" "stamps" "")
    (SETVAR "CMDECHO" CMD)
    (PRINT "THIS DRAWING HAS BEEN ISSUED FOR CONSTRUCTION")
    (PRINC))

    It's stoping the muti-batch after it runs, i can't figure out how to get it running again.
    If i type resume at the command prompt, it does proceed to the next drawing but again it stops.
    if i add resume to the script of multibatch, it still don't read it.
    HELP!!!
    Please

    Thanks,
    Viktor
     
    VikCAD04, Oct 8, 2004
    #1
  2. VikCAD04

    VikCAD04 Guest

    so i tested and tested, and found the problem, but not sure how to work around it now.

    notice that towards the bottom, i'm using Draworder command to set previous to the back, and afrerwards i find image and set it back after that.
    Well, not all my drawings have images, most don't. So when i run that manually it runs fine, just errors through it cause it don't find a image.
    But when i load it through the Multi-batch, it's very picky and don't allow me to do that.
    So i guess i need to set some conditions or evaluations to see if the image is there or not.
    how do i do that?
    thanks,
    Viktor
     
    VikCAD04, Oct 9, 2004
    #2
  3. VikCAD04

    DaveS Guest

    (if (ssget "x" '((0 . "IMAGE")))
    (do stuff)


    If you don't have an image it will return nil.

    Have fun,
    Dave
     
    DaveS, Oct 9, 2004
    #3
  4. VikCAD04

    CAB2k Guest

    (if (setq ssimage (ssget "x" '((0 . "IMAGE"))))
    (command ".draworder" "l" "" "b"
    ".draworder" ssimage "" "b"
    ".layer" "lo" "stamps" "")
    ); endif
     
    CAB2k, Oct 9, 2004
    #4
  5. VikCAD04

    VikCAD04 Guest

    you're a life saver!
    thanks a bunch, i didn't know i could have a if function working like that.
    i guess that's why i'm still learning.

    Thanks, again.
    Viktor
     
    VikCAD04, Oct 9, 2004
    #5
  6. VikCAD04

    CAB2k Guest

    Your welcome.
    We are all still learning. :)
     
    CAB2k, Oct 9, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.