Dynamic Input & Lisp

Discussion in 'AutoCAD' started by tstright, Apr 5, 2005.

  1. tstright

    tstright Guest

    My Lisp routines work when I have dynamic input off, but with it on they bomb?

    Can someone give me a direction to head???
     
    tstright, Apr 5, 2005
    #1
  2. tstright

    Jeff Mishler Guest

    Maybe post what works and what doesn't. Otherwise Imight send you to the
    moon instead of the north pole where you had wanted to be....
    ;-)
     
    Jeff Mishler, Apr 5, 2005
    #2
  3. tstright

    tstright Guest

    How true..
    Since I've only had 06 for avout 3 hours I will give more details when I can explain them better....
     
    tstright, Apr 6, 2005
    #3
  4. Does your code use (grread) or something?

    I've not seen any problems with code that uses the
    standard GetXxxxxx functions, and I'd be interested
    in hearing about any quirks you may come across.
     
    Tony Tanzillo, Apr 6, 2005
    #4
  5. tstright

    tstright Guest

    I did'nt write it.... I just have to maintain it or come up with something better.


    ; The Floor Sleeve portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun c:SLV ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "FLOOR-SLEEVES" "COLOR" "8" "" "")
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length (depth): "))

    ; Input to AutoCAD's command line.
    (command
    "insert"
    "slv"
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Floor Sleeve with water stop portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun c:WF ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length (depth): "))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "FLOOR-SLEEVES" "COLOR" "8" "" "")
    (command
    "insert"
    "wsfslv"
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    ; The Wall Sleeve portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun c:WS ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP ROT DEG OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of WSLV halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the Diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length: "))

    ; GET a ANG from the user and store it in ROT.
    (setq ROT (getangle "\nEnter the sleeve rotation angle: "))

    ; OPERATION - store the result in DEG.
    (setq DEG (angtos rot 0 4))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "WALL-SLEEVES" "COLOR" "8" "" "")
    (command
    "insert"
    "wslv"
    inspt1
    dia
    deep
    ""
    dia
    deep
    "rotate"
    "l"
    ""
    inspt1
    "r"
    "90"
    deg
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )


    ; This is the Wall Sleeve with water stop portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun c:WW ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP ROT DEG OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of WSLV halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the Diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length: "))

    ; GET a ANG from the user and store it in ROT.
    (setq ROT (getangle "\nEnter the sleeve rotation angle: "))

    ; OPERATION - store the result in DEG.
    (setq DEG (angtos rot 0 4))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "WALL-SLEEVES" "COLOR" "8" "" "")
    (command
    "insert"
    "wswslv"
    inspt1
    dia
    deep
    ""
    dia
    deep
    "rotate"
    "l"
    ""
    inspt1
    "r"
    "90"
    deg
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    (defun c:CORE ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DMTR DRILL OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset core drill: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset core drill: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the core drill location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the core drill: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the core drill depth: "))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "CORE-DRILL" "COLOR" "8" "" "")
    (command
    "insert"
    "cd"
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Floor Drain portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun c:FD ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset the floor drain: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset the floor drain: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the drain location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the floor drain: "))


    ; GET a string from the user and store it in typ.
    (setq typ (getstring "\Enter the Type of floor drain: "))


    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "FLOOR-DRAIN" "COLOR" "8" "" "")
    (command "insert" "floordrn" inspt1 dia "" "" dia typ)
    (command "erase" xl1 xl2 "")

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Roof Drain portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun c:RD ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset the roof drain: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset the roof drain: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the drain location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the roof drain: "))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "ROOF-DRAIN" "COLOR" "8" "" "")
    (command
    "insert"
    "roofdrn"
    inspt1
    (getvar "ltscale")
    ""
    ""
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Clean Out portion of the program.
    ; This program was created on April 25, 2001.

    ; Define the function (the program).
    (defun c:clo ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset the Clean Out: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset the Clean Out: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the Clean Out location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the Clean Out: "))

    ; Input to AutoCAD's command line.
    (COMMAND "-LAYER" "MAKE" "CLEAN-OUT" "COLOR" "8" "" "")
    (command
    "insert"
    "clo"
    inspt1
    dia
    ""
    ""
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; The Floor Sleeve by Systems the program.

    ; Define the function (the program).
    (defun C:sysSLV ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length (depth): "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-Floor-Sleeves" "H-Floor-Sleeves") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-slv" "h-slv")
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    ; Define the function ProSet Sleeve (the program).
    (defun C:sysSLV-ps ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length (depth): "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-Floor-PS-Sleeves" "H-Floor-PS-Sleeves") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-slvps" "h-slvps")
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Floor Sleeve with water stop portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun C:sysWF ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length (depth): "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-Floor-Sleeves" "H-Floor-Sleeves") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-wsfslv" "h-wsfslv")
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    ; The Wall Sleeve portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun C:sysWS ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP ROT DEG OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of WSLV halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the Diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length: "))

    ; GET a ANG from the user and store it in ROT.
    (setq ROT (getangle "\nEnter the sleeve rotation angle: "))

    ; OPERATION - store the result in DEG.
    (setq DEG (angtos rot 0 4))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-Wall-Sleeves" "H-Wall-Sleeves") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-wslv" "h-wslv")
    inspt1
    dia
    deep
    ""
    dia
    deep
    "rotate"
    "l"
    ""
    inspt1
    "r"
    "90"
    deg
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )


    ; The ProSet Wall Sleeve portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun C:sysWS-ps ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP ROT DEG OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of WSLV halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the Diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length: "))

    ; GET a ANG from the user and store it in ROT.
    (setq ROT (getangle "\nEnter the sleeve rotation angle: "))

    ; OPERATION - store the result in DEG.
    (setq DEG (angtos rot 0 4))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-PS-Wall-Sleeves" "H-PS-Wall-Sleeves") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-wslvps" "h-wslvps")
    inspt1
    dia
    deep
    ""
    dia
    deep
    "rotate"
    "l"
    ""
    inspt1
    "r"
    "90"
    deg
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    ; This is the Wall Sleeve with water stop portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun C:sysWW ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA DEEP ROT DEG OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of WSLV halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset sleeve: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the sleeve location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the Diameter of the sleeve: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the sleeve length: "))

    ; GET a ANG from the user and store it in ROT.
    (setq ROT (getangle "\nEnter the sleeve rotation angle: "))

    ; OPERATION - store the result in DEG.
    (setq DEG (angtos rot 0 4))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-Wall-Sleeves" "H-Wall-Sleeves") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-wswslv" "h-wswslv")
    inspt1
    dia
    deep
    ""
    dia
    deep
    "rotate"
    "l"
    ""
    inspt1
    "r"
    "90"
    deg
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    ; This is the Core Drill portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    (defun C:sysCORE ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DMTR DRILL OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset core drill: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset core drill: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the core drill location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; Get System Type for sleeves (Plumbing Or HVAC)
    (setq sys1 (STRCASE(getstring "\nEnter type of system for sleeve(P for Plumbing, H for HVAC): ")))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the core drill: "))

    ; GET a DIST from the user and store it in DEEP.
    (setq DEEP (getdist "\nEnter the core drill depth: "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" (if (= sys1 "P") "P-Core Drill" "H-Core Drill") "color" (if (= sys1 "P") "5" "3") "" "")
    (command
    "insert"
    (if (= sys1 "P") "p-cd" "h-cd")
    inspt1
    dia
    ""
    ""
    deep
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Floor Drain portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun C:sysFD ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset the floor drain: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset the floor drain: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the drain location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the floor drain: "))

    ; GET a INT from the user and store it in DIA.
    (setq typ (getstring "\nEnter the type of floor drain: "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" "P-Floor-Drains" "color" "5" "" "")
    (command
    "insert"
    "floordrn"
    inspt1
    dia
    ""
    ""
    dia
    typ
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Roof Drain portion of the program.
    ; This program was created on March 25 1997 using the LISP Generator.

    ; Define the function (the program).
    (defun C:sysRD ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset the roof drain: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset the roof drain: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the drain location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the floor drain: "))

    ; GET a INT from the user and store it in DIA.
    (setq typ (getstring "\nEnter the type of floor drain: "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" "P-Floor-Drains" "color" "5" "" "")
    (command
    "insert"
    "ROOFdrn"
    inspt1
    dia
    ""
    ""
    dia
    typ
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )

    : The Clean Out portion of the program.
    ; This program was created on April 25, 2001.

    ; Define the function (the program).
    (defun C:sysclo ( / L1 OFF1 XL1 L2 OFF2 XL2 OS1 OS2 INSPT1 OSOLD DIA OLDCE OLDRQ OLDERR OLDTE)
    ; Save the current value of cmdecho then redefine it.
    (setq OLDCE (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    ; Save the current value of texteval then set it to 1
    (setq OLDTE (getvar "texteval"))
    (setvar "texteval" 1)
    ; Save the current value of attdia then set it to 0
    (setq OLDAT (getvar "attdia"))
    (setvar "attdia" 0)
    ; Save the current value of attreq then set it to 0
    (setq OLDRQ (getvar "attreq"))
    (setvar "attreq" 1)
    ; Save the current value of the error handling subroutine then redefine it.
    (setq OLDERR *error*)
    (defun *error* (errmes)
    (princ (strcat "\nExecution of SLEEVE halted by the following error: " ERRMES))
    (setvar "cmdecho" OLDCE)
    (setq *error* OLDERR)
    (prin1)
    )
    ;(setq *error* nil)
    ; NOTE: to turn error handling off, erase the semicolon in the line above.

    ; GET a ENTITY from the user and store it in L1.
    (setq L1 (car (entsel "\nSelect the first line from which to offset the Clean Out: ")))

    ; GET a DIST from the user and store it in OFF1.
    (setq OFF1 (getdist "\nEnter the distance to offset from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off1
    l1 PAUSE
    ""
    )

    ; OPERATION - store the result in XL1.
    (setq XL1 (ENTLAST))

    ; GET a ENTITY from the user and store it in L2.
    (setq L2 (car (entsel "\nSelect the second line from which to offset the Clean Out: ")))

    ; GET a DIST from the user and store it in OFF2.
    (setq OFF2 (getdist "\nEnter the offset distance from this line: "))

    ; Input to AutoCAD's command line.
    (command
    "xline"
    "o"
    off2
    l2 PAUSE
    ""
    )

    ; OPERATION - store the result in XL2.
    (setq XL2 (ENTLAST))

    ; OPERATION - store the result in OS1.
    (setq OS1 (GETVAR "osmode"))

    ; OPERATION - store the result in OS2.
    (setq OS2 (SETVAR "osmode" 32))

    ; GET a POINT from the user and store it in INSPT1.
    (setq INSPT1 (getpoint "\nPick the Clean Out location intersection: "))

    ; OPERATION - store the result in OSOLD.
    (setq OSOLD (SETVAR "osmode" OS1))

    ; GET a INT from the user and store it in DIA.
    (setq DIA (getint "\nEnter the diameter of the Clean Out: "))

    ; Input to AutoCAD's command line.
    (command "-layer" "make" "P-Clean-outs" "color" "5" "" "")
    (command
    "insert"
    "p-clo"
    inspt1
    dia
    ""
    ""
    dia
    "erase"
    xl1
    xl2
    ""
    )

    ; Reset "cmdecho" to previous value.
    (setvar "cmdecho" OLDCE)
    ; Reset "texteval" to previous value.
    (setvar "texteval" OLDTE)
    ; Reset "attdia" to previous value.
    (setvar "attdia" OLDAT)
    ; Reset "attreq" to previous value.
    (setvar "attreq" OLDRQ)
    ; Reset *error* to previous definition.
    (setq *error* OLDERR)
    ; Exit quietly (no return value.)
    (prin1)
    )
     
    tstright, Apr 6, 2005
    #5
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.