dumb lisp!

Discussion in 'AutoCAD' started by Jamie Duncan, Mar 29, 2005.

  1. Jamie Duncan

    Jamie Duncan Guest

    actually dumb me. can't find where this is going wrong
    this is the part I added:


    ;;; PLUMBING
    ((= temp "P")
    (command ".layer" "m" "FPR" "m" "FPRRI" "c" "1" "FPR,FPRRI" "m"
    "PSA" "m" "PSARI" "c" "6" "PSA,PSARI" "")
    (if (null (tblsearch "block" "arctasq")) Fire Hose Cabinet
    (jdd_mkblock "arctasq" (list -0.5 0.97 -0.5 -0.03 0.5
    0.97 -0.5 0.97 0.5 0.97 0.5 -0.03 -0.53 -0.03 0.53 -0.03))
    )
    (if (null (tblsearch "block" "arctfdrn"))valance lighting
    (progn
    (entmake '((0 . "BLOCK")(2 . "arctfdrn")(70 . 0)(10 0.0
    0.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 -0.1667 -0.4713927
    0.0)(11 -0.1667 0.4713927 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 0.1667 -0.4713927
    0.0)(11 0.1667 0.4713927 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 -0.4713927 0.1667
    0.0)(11 0.4713927 0.1667 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 -0.4713927 -0.1667
    0.0)(11 0.4713927 -0.1667 0.0)))
    (entmake '((0 . "CIRCLE")(8 . "0")(10 0.0 0.0 0.0)(40 .
    0.5)))
    (entmake '((0 . "ENDBLK")))
    )
    )
    (setq ss1 (ssget "_C" (getvar "limmax")(getvar "limmin")(list
    (cons 0 "INSERT")(cons 8 "HHA_PN_SYMB-EC")(CONS -4 "<OR")(cons 2
    "A33*")(cons 2 "A34-24D")(cons 2 "A21-10C")(cons -4 "OR>")))
    counter 0
    ss2 (ssadd)
    rad_list (list (cons "A33-04" 0.4)(cons "A33-55A"
    0.875)(cons "A33-55B" 0.25)(cons "A33-55C" 0.20)(cons "A21-10C" 0.9))
    )
    (repeat (sslength ss1)
    (setq ent_name (ssname ss1 counter) ent_data (entget
    ent_name) counter (+ 1 counter))
    (jdd_getinsprops)
    (cond
    ((= bname1 "E34-24D");;;FHC
    (jdd_mkins "arctasq" "FPR" pt1 (* scalx 7.6) (* scalx
    7.6) ang1)(ssadd (entlast) ss2)
    )
    ((= bname1 "A33-01A");;; floor drain
    (jdd_mkins "arctfdrn" "PSA" pt1 (* scalx 2.0) (*
    scalx 2.0) ang1)(ssadd (entlast) ss2)
    )
    ((member bname1 (list "A33-55A" "A33-55B" "A33-55C"
    "A33-04" "A21-10C"))
    (setq lay_nam (if (= bname1 "A21-10C") "FPRRI"
    "PSARI"))
    (entmake '((0 . "CIRCLE")(cons 8 lay_nam)(cons 10
    pt1)(cons 40 (* scalx (cdr (assoc bname1 rad_list))))))
    (ssadd (entlast) ss2)
    )
    )
    );;; repeat
    (jdd_wblock "FAIA X-PLUMBING.dwg" ss2)
    );;; end of plumbing

    the whole thing with support functions is below - don't worry about sysvars
    and error trapping - that will be added later.
    Princess Jamie

    here is the whole lisp

    (defun c:hha2faia (/ ss1 ss2 pt1 pt2 ptlmin ptlmax file_name file_type
    layer_list counter ent_name ent_data ang1 rad1 bname1 scalx scaly ss2)
    ;;;Internal error handler
    ;;; (defun faiahhaerr (st) ; Internal error handler
    ;;; (if (or (/= st "Function cancelled")(= st "quit / exit abort"))
    ;;; (princ)
    ;;; (princ (strcat "\nError: " st))
    ;;; )
    ;;; (jddresetvars)
    ;;; (princ)
    ;;; )
    ;;; (setq *error* faiahhaerr)
    ;;;(arctvsav)
    (setvar "gridmode" 0)(setvar "cmdecho" 0)(setvar "regenmode" 0)
    ;;;restore sysvars affected by this routine
    (defun jddresetvars (/)
    ;;;(arctvrst)
    (setvar "limmin" (list (car ptlmin)(cadr ptlmin)))(setvar "limmax" (list
    (car ptlmax)(cadr ptlmax)))
    );;; end of restore vars

    ;;;function to set selection window
    (defun set_limits (/ temp)
    (setq looper T ptlmin (getvar "limmin") ptlmax (getvar "limmax"))(setvar
    "limcheck" 0)
    (draw_scrbox ptlmin ptlmax)
    (initget "A")
    (while looper
    (setq temp (getpoint "\nSelect Bottom Left Hand Corner of Drawing
    Area to Process or <Accept>: "))
    (princ temp)
    (if (or (= temp nil)(= temp "A"))
    (setq looper nil)
    (progn
    (setq ptlmin temp)
    (initget 41)
    (setq ptlmax (getcorner ptlmin "\nSelect Top Right Hand Corner
    of Selection Box"))
    (draw_scrbox ptlmin ptlmax)
    (initget "A")
    )
    )
    )
    (command ".redraw")
    (setvar "limmin" (list (car ptlmin)(cadr ptlmin)))(setvar "limmax" (list
    (car ptlmax)(cadr ptlmax)))
    );;;end of set_limits

    (defun jdd_getinsprops (/) ;;; private function to get and set insert data
    (setq pt1 (cdr (assoc 10 ent_data)) ang1 (cdr (assoc 50 ent_data)) bname1
    (strcase (cdr (assoc 2 ent_data)))
    scalx (cdr (assoc 41 ent_data)) scaly (cdr (assoc 42 ent_data)))
    )


    ;;;Begin Main Program
    ;;;save system variables
    (setq h_mode (getvar "highlight") cmd_mode (getvar "cmdecho") ortho_mode
    (getvar "orthomode")
    o_smode (getvar "osmode") file_mode (getvar "filedia") cur_tab
    (getvar "ctab") cur_ltscale (getvar "ltscale"))
    (command ".undo" "group")
    (setvar "ctab" "model")(setvar "gridmode" 0)
    (arctvsav)(setvar "EXPERT" 0)
    (setvar "ltscale" (* 2.54 cur_ltscale))
    (command "-layer" "s" "0" "t" "*" "on" "*" "un" "*" "")
    (command "ucs" "world" "-view" "o" "t" "ucs" "world")
    (set_limits)
    (initget "S D L E X P")
    (setq temp (getkword "\nSelect Output File - Diffusers/Lights/Elect
    panels/Sprinkler/Plumbing/eXit <eXit>: "))
    (cond
    ((= temp "D");;;HVAC diffusers
    (map_layers (list (list "MHVCD" "11" "CONTINUOUS" "Plot")(list
    "MHVCDPA" "193" "CONTINUOUS" "N")) "HHA_VN_RDIFF-FC,HHA_VN_SDIFF-FC")
    (if (null (tblsearch "block" "arcthgrl"))
    (jdd_mkblock "arcthgrl" (append (jdddraw_box '(0.02 -0.02)
    '(0.98 -0.98))(list 0.02 -0.18 0.98 -0.18 0.02 -0.34 0.98 -0.34 0.02 -0.5
    0.98 -0.5 0.02 -0.66 0.98 -0.66 0.02 -0.82 0.98 -0.82)))
    )
    (if (null (tblsearch "block" "arcthdfs"))
    (jdd_mkblock "arcthdfs" (append (jdddraw_box '(0.02 -0.02)
    '(0.98 -0.98))(jdddraw_box '(0.17 -0.17) '(0.81 -0.81))(jdddraw_box
    '(0.32 -0.32) '(0.66 -0.66))))
    )
    (if (null (tblsearch "block" "arctlindif4x48"))
    (jdd_mkblock "arctlindif4x48" (append (jdddraw_box '(0.02 0.02)
    '(47.98 3.98))(jdddraw_box '(0.75 0.75) '(47.25 3.25))))
    )
    (command "-layer" "m" "MHVCD" "")
    (setq ss1 (ssget "_C" (getvar "limmax")(getvar "limmin")) counter 0
    ss2 (ssadd))
    (repeat (sslength ss1)
    (setq ent_name (ssname ss1 counter) ent_data (entget ent_name)
    counter (+ counter 1))
    (if (= (cdr (assoc 0 ent_data)) "INSERT")
    (progn
    (jdd_getinsprops)(princ bname1)
    (cond
    ((or (= bname1 "A32-33C")(= bname1
    "A32-33D"));;; 12" diffuser
    (jdd_mkins "arcthdfs" "MHVCD" (polar pt1 (+
    ang1 (* pi 0.75))(/ 150.0 (cos (/ pi 4)))) 300.0 300.0 ang1)
    (ssadd (entlast) ss2)
    )
    ((or (= bname1 "A32-33A")(= bname1 "A32-33E")(=
    bname1 "A32-33B"));;; 24" diffuser
    (jdd_mkins "arcthdfs" "MHVCD" (polar pt1 (+ ang1
    (* pi 0.75))(/ 300.0 (cos (/ pi 4)))) 600.0 600.0 ang1)(setq bname1
    "arcthdfs" rad1 300.0)
    (ssadd (entlast) ss2)
    )
    ((= bname1 "A32-50A")
    (jdd_mkins "arcthgrl" "MHVCD" (polar pt1 (+
    ang1 (* pi 0.75))(/ 300.0 (cos (/ pi 4)))) 600.0 600.0 ang1)(setq bname1
    "arcthdfs" rad1 300.0)
    (ssadd (entlast) ss2)
    )
    ((= bname1 "A32-50C")
    (jdd_mkins "arcthgrl" "MHVCD" (polar (polar
    pt1 ang1 -152.4)(+ ang1 (/ PI 2)) -304.8) 609.6 304.8 (+ ang1 (/ PI
    2)))(setq bname1 "arcthdfs" rad1 300.0)
    (ssadd (entlast) ss2)
    )
    ((= bname1 "A32-50B")
    (jdd_mkins "arcthgrl" "MHVCD" (polar pt1 (+
    ang1 (* pi 0.75))(/ 150.0 (cos (/ pi 4)))) 300.0 300.0 ang1)(ssadd (entlast)
    ss2)
    )
    ((= bname1 "4FTLINEAR")(princ "\nHere")
    (jdd_mkins "arctlindif4x48" "MHVCD" (polar
    (polar pt1 (+ ang1 PI) (* scalx 4.0 25.4))(+ ang1 (* 0.5 PI))(* scaly 0.375
    25.4)) (* scalx 25.4) (* scaly 25.4) (+ ang1 (* 1.5 PI)))
    (ssadd (entlast) ss2)
    )
    (t
    (command ".copy" (ssadd ent_name) "" "0,0"
    "0,0")
    (entmod (subst (cons 8 "MHVCDPA")(assoc 8
    (entget (entlast)))(entget (entlast))))
    )
    );;;end blockname cond
    ;;; (command "-insert" bname1 (polar pt1 (+ ang1 (* pi
    0.75))(/ rad1 (cos (/ pi 4))))(* 2.0 rad1) "" (* ang1 (/ 180 pi)))
    );;;end progn
    ;;;(progn
    ;;;(command ".copy" (ssadd ent_name) "" "0,0" "0,0")
    ;;;(entmod (subst (cons 8 "MHVCDPA")(assoc 8 (entget
    (entlast)))(entget (entlast))))
    ;;;(ssadd (entlast) ss2)
    ;;;l);; end progn
    );;;end if
    );;; end repeat
    (jdd_wblock "FAIA X-HVAC.dwg" ss2)
    );;; end diffusers
    ((= temp "S") ;;; Sprinklers
    (map_layers (list (list "FSP" "41" "CONTINUOUS" "Plot")(list
    "FPR" "1" "CONTINUOUS" "Plot" )(list "FPRLN" "43" "CONTINUOUS" "Plot"))
    "HHA_SN_HEAD-EC,HHA_PN_SYMB-EC,HHA_SN_HEAD-FC,HHA_SX_SYMB-LC")
    (if (null (tblsearch "block" "arctfspr"));;; sprinkler head
    (progn
    (entmake '((0 . "BLOCK")(2 . "arctfspr")(70 . 0)(10 0.0
    0.0 0.0)))
    (entmake '((0 . "CIRCLE")(8 . "0")(10 0.0 0.0 0.0)(40 .
    1.75)))
    (entmake '((0 . "LINE")(8 . "0")(10 1.9 -1.9
    0.0)(11 -1.9 1.9 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 1.9 1.9
    0.0)(11 -1.9 -1.9 0.0)))
    (entmake '((0 . "ENDBLK")))
    )
    )
    (if (null (tblsearch "block" "arctfscc"));;; sprinkler control
    cabinet
    (jdd_mkblock "arctfscc" (append (jdddraw_box '(-0.5 0.0)
    '(0.5 1.0))(jdddraw_box '(-0.53 -0.05)'(0.53 0.0))(list -0.125 0.25 0.125
    0.75 0.125 0.25 -0.125 0.75 -0.125 0.25 -0.125 0.75 0.125 0.25 0.125 0.75)))
    )
    (setq ss1 (ssget "_C" (getvar "limmax")(getvar "limmin"))
    counter 0 ss2 (ssadd))
    (repeat (sslength ss1)
    (setq ent_name (ssname ss1 counter) ent_data (entget ent_name)
    counter (+ counter 1))
    (if (= (cdr (assoc 0 ent_data)) "INSERT")
    (progn
    (jdd_getinsprops)
    (cond ;;;check for insert names
    ((or (= bname1 "A34-55")(= bname1 "A34-56")(= bname1
    "A34-19"));;;sprinkler head
    (jdd_mkins "arctfspr" "FSP" pt1 25.0 25.0
    0.0)(ssadd (entlast) ss2)
    )
    ((or (= bname1 "A33-09B")(= bname1 "A33-09C")(=
    bname1 "A33-55A")(= bname1 "A21-10C"));;;sprinkler risers
    (if (= bname1 "A33-09C")(setq rad1 25.0)(setq
    rad1 50.0))
    (entmake (list (cons 0 "CIRCLE")(cons 8
    "FPRLN")(cons 10 pt1)(cons 40 rad1)))(ssadd (entlast) ss2)
    )
    ((= bname1 "A34-51");;;sprinkler control cabinet
    (jdd_mkins "arctfscc" "FPR" (polar pt1 (+ ang1 (/ pi
    2)) -150.0) 760.0 (* 300.0 (/ scaly (abs scaly))) ang1)(ssadd (entlast) ss2)
    )
    );;; end insert cond
    );;; end of insert progn
    (if (= (cdr (assoc 2 ent_data)) "HHA_SX_SYMB-LC")
    (progn
    (command ".copy" (ssadd ent_name) "" "0,0" "0,0")
    (entmod (subst (cons 8 "FPRLN")(assoc 8 (entget
    (entlast)))(entget (entlast))))(ssadd (entlast) ss2)
    )
    )
    );;; endof insert if
    );;; end if repeat
    (jdd_wblock "FAIA X-SPRINKLER.dwg" ss2)
    );;;end of sprinklers
    ((= temp "L");;; beginning of lighting
    (map_layers (list (list "ELI" "31" "CONTINUOUS" "PLOT")(list
    "ELIOV" "41" "DASHED4" "PLOT")(list "ELIWD" "42" "DASHED4" "N"))
    "HHA_LN_CFIX-FC,HHA_LN_CFIX-EC")
    (if (null (tblsearch "block" "arctf1x4"));;; 1x4 fluroescent
    (jdd_mkblock "arctf1x4" (append (jdddraw_box '(1.0 -1.0)
    '(47.0 -11.0))(list 1.0 -11.0 47.0 -1.0)))
    )
    (if (null (tblsearch "block" "arctf2x2"));;; 2x2 fluroescent
    (jdd_mkblock "arctf2x2" (append (jdddraw_box '(1.0 -1.0)
    '(23.0 -23.0))(list 1.0 -23.0 23.0 -1.0)))
    )
    (if (null (tblsearch "block" "arctf2x4"));;; 2x4 fluroescent
    (jdd_mkblock "arctf2x4" (append (jdddraw_box '(1.0 -1.0)
    '(47.0 -23.0))(list 1.0 -23.0 47.0 -1.0)))
    )
    (if (null (tblsearch "block" "arctfva4"));;;valance lighting
    (progn
    (entmake '((0 . "BLOCK")(2 . "arctfva4")(70 . 0)(10 0.0
    0.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 0.0 0.0 0.0)(11 48.0
    0.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 0.0 -2.0 0.0)(11 0.0
    2.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 48.0 -2.0 0.0)(11
    48.0 2.0 0.0)))
    (entmake '((0 . "ENDBLK")))
    )
    )
    (if (null (tblsearch "block" "arctfva3"));;;valance lighting
    (progn
    (entmake '((0 . "BLOCK")(2 . "arctfva3")(70 . 0)(10 0.0
    0.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 0.0 0.0 0.0)(11 36.0
    0.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 0.0 -2.0 0.0)(11 0.0
    2.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 36.0 -2.0 0.0)(11
    36.0 2.0 0.0)))
    (entmake '((0 . "ENDBLK")))
    )
    )
    (if (null (tblsearch "block" "arctwallwasher"));;;wallwasher
    (progn
    (setq ARCTBLK (strcat ARCTBLKG "arctltww"))(command
    "-insert" ARCTBLK "0,0" "1" "" "0")
    (entdel (entlast))
    )
    )
    (if (null (tblsearch "block" "arctlt2"));;;incanderscent
    (progn
    (setq ARCTBLK (strcat ARCTBLKG "arctlt2"))(command
    "-insert" ARCTBLK "0,0" "1" "" "0")
    (entdel (entlast))
    )
    )
    (setq ss1 (ssget "_C" (getvar "limmax")(getvar "limmin")) counter
    0 ss2 (ssadd))
    (repeat (sslength ss1)
    (setq ent_name (ssname ss1 counter) ent_data (entget ent_name)
    counter (+ counter 1))
    (if (= (cdr (assoc 0 ent_data)) "INSERT")
    (progn
    (jdd_getinsprops)
    (cond
    ((or (= bname1 "E11-01A")(= bname1
    "E11-01B"));;;fLUROESCENT 1X4 EMERGENCY
    (jdd_mkins "arctf1x4" "ELI" pt1 (* scalx -0.25) (*
    scalx 0.25) (+ ang1 PI))(ssadd (entlast) ss2)
    )
    ((or (= bname1 "E11-09A")(= bname1 "E11-10A")(= bname1
    "E11-10B"));;;incandescent
    (jdd_mkins "arctlt2" "ELI" pt1 (* scalx 2.4) (*
    scalx 2.4) ang1)(ssadd (entlast) ss2)
    )
    ((= bname1 "E11-03M2");;;valance 1 tube by 4
    (jdd_mkins "arctfva4" "ELIOV" pt1 (* scalx 0.254)
    (* scaly 0.254) ang1)(ssadd (entlast) ss2)
    )
    ((= bname1 "E11-03P2");;;valance 1 tube x 3
    (jdd_mkins "arctfva3" "ELIOV" pt1 (* scalx 0.254)
    (* scaly 0.254) ang1)(ssadd (entlast) ss2)
    )
    (t
    (command ".copy" (ssadd ent_name) "" "0,0" "0,0")
    (entmod (subst (cons 8 "ELI")(assoc 8 (entget
    (entlast)))(entget (entlast))))(ssadd (entlast) ss2)
    )
    );;; end inner cond
    );;; end progn
    );;; end if
    );;; end repeat
    (jdd_wblock "FAIA X-LIGHTING.dwg" ss2)
    );;; end of lighting cond
    ;;; PLUMBING
    ((= temp "P")
    (command ".layer" "m" "FPR" "m" "FPRRI" "c" "1" "FPR,FPRRI" "m"
    "PSA" "m" "PSARI" "c" "6" "PSA,PSARI" "")
    (if (null (tblsearch "block" "arctasq")) Fire Hose Cabinet
    (jdd_mkblock "arctasq" (list -0.5 0.97 -0.5 -0.03 0.5
    0.97 -0.5 0.97 0.5 0.97 0.5 -0.03 -0.53 -0.03 0.53 -0.03))
    )
    (if (null (tblsearch "block" "arctfdrn"))valance lighting
    (progn
    (entmake '((0 . "BLOCK")(2 . "arctfdrn")(70 . 0)(10 0.0
    0.0 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 -0.1667 -0.4713927
    0.0)(11 -0.1667 0.4713927 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 0.1667 -0.4713927
    0.0)(11 0.1667 0.4713927 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 -0.4713927 0.1667
    0.0)(11 0.4713927 0.1667 0.0)))
    (entmake '((0 . "LINE")(8 . "0")(10 -0.4713927 -0.1667
    0.0)(11 0.4713927 -0.1667 0.0)))
    (entmake '((0 . "CIRCLE")(8 . "0")(10 0.0 0.0 0.0)(40 .
    0.5)))
    (entmake '((0 . "ENDBLK")))
    )
    )
    (setq ss1 (ssget "_C" (getvar "limmax")(getvar "limmin")(list
    (cons 0 "INSERT")(cons 8 "HHA_PN_SYMB-EC")(CONS -4 "<OR")(cons 2
    "A33*")(cons 2 "A34-24D")(cons 2 "A21-10C")(cons -4 "OR>")))
    counter 0
    ss2 (ssadd)
    rad_list (list (cons "A33-04" 0.4)(cons "A33-55A"
    0.875)(cons "A33-55B" 0.25)(cons "A33-55C" 0.20)(cons "A21-10C" 0.9))
    )
    (repeat (sslength ss1)
    (setq ent_name (ssname ss1 counter) ent_data (entget
    ent_name) counter (+ 1 counter))
    (jdd_getinsprops)
    (cond
    ((= bname1 "E34-24D");;;FHC
    (jdd_mkins "arctasq" "FPR" pt1 (* scalx 7.6) (* scalx
    7.6) ang1)(ssadd (entlast) ss2)
    )
    ((= bname1 "A33-01A");;; floor drain
    (jdd_mkins "arctfdrn" "PSA" pt1 (* scalx 2.0) (*
    scalx 2.0) ang1)(ssadd (entlast) ss2)
    )
    ((member bname1 (list "A33-55A" "A33-55B" "A33-55C"
    "A33-04" "A21-10C"))
    (setq lay_nam (if (= bname1 "A21-10C") "FPRRI"
    "PSARI"))
    (entmake '((0 . "CIRCLE")(cons 8 lay_nam)(cons 10
    pt1)(cons 40 (* scalx (cdr (assoc bname1 rad_list))))))
    (ssadd (entlast) ss2)
    )
    )
    );;; repeat
    (jdd_wblock "FAIA X-PLUMBING.dwg" ss2)
    );;; end of plumbing
    );;;end outer main cond
    (jddresetvars)
    (princ)
    );;; end main function

    (defun draw_scrbox ( pt1 pt2 /)
    (command ".redraw")
    (grdraw pt1 (list (car pt2)(cadr pt1)) 2 1)
    (grdraw (list (car pt2)(cadr pt1)) pt2 2 1)
    (grdraw pt2 (list (car pt1)(cadr pt2)) 2 1)
    (grdraw (list (car pt1)(cadr pt2)) pt1 2 1)
    )
    (defun map_layers ( layerlistr layerlist1 / l1)
    (command "-layer" "s" "0" "off" "*" "n" "on" layerlist1 "")
    (foreach l1 layerlistr
    (command "-layer" "m" (car l1) "c" (cadr l1)(car l1) "L" (caddr
    l1)(car l1) "Plot" (cadddr l1)(car l1) "")
    )
    )
    (defun jdd_mkblock ( blk_name blk_list / enl1 ctr pt1 pt2 temp)
    (entmake (list (cons 0 "BLOCK")(cons 2 blk_name)(cons 70 0)(cons 10 '(0.0
    0.0 0.0))))
    (setq ctr 1)
    (foreach enl1 blk_list
    (cond
    ((= ctr 1)(setq temp enl1))
    ((= ctr 2)(setq pt1 (list temp enl1)))
    ((= ctr 3)(setq temp enl1))
    ((= ctr 4)
    (setq pt2 (list temp enl1))
    (entmake (list (cons 0 "LINE")(cons 8 "0")(cons 10 pt1)(cons 11
    pt2)))
    )
    )
    (if (= ctr 4)(setq ctr 1)(setq ctr (+ 1 ctr)))
    )
    (entmake '((0 . "ENDBLK")))
    )
    (defun jdddraw_box ( pta ptb /)
    (list (car pta)(cadr pta)(car ptb)(cadr pta)(car ptb)(cadr pta)(car
    ptb)(cadr ptb)(car ptb)(cadr ptb)(car pta) (cadr ptb)(car pta)(cadr
    ptb)(car pta)(cadr pta))
    )
    (defun jdd_wblock ( f_name stuff1 /)
    (if (vl-directory-files (getvar "dwgprefix") f_name 1)(vl-file-delete
    (strcat (getvar "dwgprefix") f_name)))
    (command "-wblock" (strcat (getvar "dwgprefix") f_name) "" "0,0" stuff1
    "")
    )
    (defun jdd_mkins ( blk_name blk_layer pt_ins xscal1 yscal1 angb /)
    (entmake (list (cons 0 "INSERT")(cons 2 blk_name)(cons 8 blk_layer)(cons
    10 pt_ins)(cons 41 xscal1)(cons 42 yscal1)(cons 50 angb)))
    )
    (defun jdd_faialtypes (/)
    (if (not (tblobjname "LTYPE" "DASHED4"))
    (entmake '((0 . "LTYPE")(100 . "AcDbSymbolTableRecord")(100 .
    "AcDbLinetypeTableRecord")(2 . "DASHED4")(70 . 0)(3 .
    "- - - - - - - - - - - - - - - - - - - - - - -")(73 . 2)(40 . 0.09375)(49 .
    0.0625)(74 . 0)(49 . -0.03125)(74 . 0)))
    )
    (if (not (tblobjname "LTYPE" "DASHED5"))
    (entmake '((0 . "LTYPE")(100 . "AcDbSymbolTableRecord")(100 .
    "AcDbLinetypeTableRecord")(2 . "DASHED5")(70 . 0)(3 .
    "- - - - - - - - - - - - - - - - - - - - - - -")(73 . 2)(40 . 0.06)(49 .
    0.04)(74 . 0)(49 . -0.02)(74 . 0)))
    )
    )
    ;;;(entget (tblobjname "LTYPE" "DASHED5"))
     
    Jamie Duncan, Mar 29, 2005
    #1
  2. Jamie Duncan

    ECCAD Guest

    Here's one problem:
    (if (null (tblsearch "block" "arctfdrn"))valance lighting
     
    ECCAD, Mar 29, 2005
    #2
  3. Jamie Duncan

    ECCAD Guest

    (if (null (tblsearch "block" "arctasq")) Fire Hose Cabinet
    And another without ";"
    Bob
     
    ECCAD, Mar 29, 2005
    #3
  4. Jamie Duncan

    Jamie Duncan Guest

    oops! very bad - this may be it!

    dumb I tell ya, just plain, no pretty dumb.
     
    Jamie Duncan, Mar 29, 2005
    #4
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.