Author Topic: Insulation Hatch?  (Read 2614 times)

0 Members and 1 Guest are viewing this topic.

Robb

  • Guest
Insulation Hatch?
« on: December 07, 2004, 05:07:15 PM »
Anyone have a batt insulation hatch? I usually array a block that I have but I end up having to explode and trim at the end. Anyone have something like this?

42

  • Bull Frog
  • Posts: 483
Insulation Hatch?
« Reply #1 on: December 07, 2004, 05:41:56 PM »
Yes. This will set the layer to A2Insulation and colour 9, then return it back to the original layer. Includes error checking if you quit out.



Code: [Select]
;;Routine to draw insulation symbol into roof/ wall sections
;;written by Andrew NIELSEN Melbourne Australia - andysan1@bigpond.com
;; call as <INSUL1>
;;first pick origin of insulation ; second pick end of insulation
;;third pick height of insulation from first pick
;; draws polyline onto layer "A2INSULATION"
;;modified by Alastair Mallett
(defun newerr (NE)
  (if (/= NE "Function bombed out ...")
     (princ (strcat "\nError:  " NE))
  )
  (command".LAYER""S"CLYR"")
  (setvar"OSMODE" OS)
  (setvar"ORTHOMODE" OM)
  (setvar"CMDECHO" CE)
  (setvar"BLIPMODE" BM)
  (command".UNDO""end")
  (princ)
);dfn

(defun C:INSUL1 (/ SP EP HT OM CE BM DX AN NX NU
             AX PX P1 P2 P3 P4 P5 P6 P7 P8 P9 XT SLST)
  (command".UNDO""group")
  (setq OS (getvar "OSMODE"))(setvar "OSMODE" 1)
  (setq OM (getvar "ORTHOMODE"))(setvar "ORTHOMODE" 1)
  (setq CE (getvar "CMDECHO"))(setvar "CMDECHO" 0)
  (setq BM (getvar "BLIPMODE"))(setvar "BLIPMODE" 0)
  (while (= SP nil) (setq SP
    (getpoint "\nPick Start Point of Insulation (Ortho is ON; O/S is End):  ")))
  (while (= EP nil) (setq EP
    (getpoint SP "\nPick Ending Point of Insulation:  ")))
   (setvar "OSMODE" 0)
  (while (= HT nil) (setq HT
    (getdist SP "\nPick or Enter Height of Insulation: ")))
  (setq CLYR (getvar"CLAYER")) (command".LAYER""M""A2INSULATION""C""8""""")
  (setq AN (angle SP EP)
        DX (distance SP EP)
        NX (/ HT 2)
        NU (/ DX NX)
        NX (/ HT 2)
        AX (+ AN (/ PI 2))
        PX (polar SP AX HT)
        P1 (polar SP AX (/ HT 1.25))
        P2 (polar P1 AN (/ HT 20))
        P3 (polar P1 AN (/ HT 4))
        P4 (polar P2 AN (/ HT 2.5))
        P5 (polar SP AX (/ HT 5))
        P6 (polar P5 AN (/ HT 5))
        P7 (polar P6 AN (/ HT 10))
        P8 (polar P5 AN (/ HT 2))
        P9 (polar SP AN (/ HT 2))
  )
  (setq SLST (ssadd))
  (repeat (fix NU)
    (command ".ARC" "C" P5 SP P6)
    (setq SLST (ssadd (entlast) SLST))
    (command ".LINE" P6 P2 "" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".ARC" P2 "C" P3 "A" "-180" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".LINE" P4 P7 "" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".ARC" "C" P8 P7 P9)
    (setq SLST (ssadd (entlast) SLST))
    (setq SP (polar SP AN NX)
          P2 (polar P2 AN NX)
          P3 (polar P3 AN NX)
          P4 (polar P4 AN NX)
          P5 (polar P5 AN NX)
          P6 (polar P6 AN NX)
          P7 (polar P7 AN NX)
          P8 (polar P8 AN NX)
          P9 (polar P9 AN NX)
    )
  )

  (setq XT (distance SP EP))
  (if (>= XT (/ HT 5))
  (progn
    (command ".ARC" "C" P5 SP P6 )
    (setq SLST (ssadd (entlast) SLST))
    (command ".LINE" P6 P2 "" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".ARC" P2 "C" P3 "A" "-75")
    (setq SLST (ssadd (entlast) SLST))
  )); end if
    (command ".PEDIT" "L" "Y" "J" SLST "" "")
   (command ".LAYER" "S" CLYR "")
  (setvar "OSMODE" OS)
  (setvar "ORTHOMODE" OM)
  (setvar "CMDECHO" CE)
  (setvar "BLIPMODE" BM)
  (command".UNDO""end")
  (princ)
);end
(princ)
Alastair Mallett Autodesk Certified Professional
Technical Director
Hunters South Architects

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Insulation Hatch?
« Reply #2 on: December 07, 2004, 07:08:27 PM »
Guess this code has been around the world :)
Code: [Select]
;;Routine to draw insulation symbol into roof/ wall sections
;;written by Andrew NIELSEN Melbourne Australia - andysan1@bigpond.com
;; call as <INSUL>
;;first pick origin of insulation ; second pick end of insulation
;;third pick height of insulation from first pick
;; draws polyline onto layer "insulation"

;;  Modified by Charles Alan Butler  02/10/2004
;;  Altered error checking & added mirror option

(defun C:INSUL (/ SP EP HT OM CE BM DX AN NX NU pt
             AX PX P1 P2 P3 P4 P5 P6 P7 P8 P9 XT SLST)
             
;; error function & Routine Exit
 (defun *error* (msg)
  (if (not(member msg
'("console break" "Function cancelled" "quit / exit abort" "")
      ))
     (princ (strcat "\nError: " msg))
  ) ; endif
    ;;reset all variables here
    (command".LAYER""S"CLYR"")
    (setvar"OSMODE" OS)
    (setvar"ORTHOMODE" OM)
    (setvar"CMDECHO" CE)
    (setvar"BLIPMODE" BM)
    (command".UNDO""end")
    (princ)
  ) ;end error function
  (defun os:off(); set osmode off & keep settings
    (if (<= (getvar "osmode") 15359)
     (setvar "osmode" (boole 6 (getvar "osmode") 16384)))
  ); defun
 
  ;; start routine
  (command".UNDO""group")
  (setq OS (getvar "OSMODE"))   (setvar "OSMODE" 512)
  (setq OM (getvar "ORTHOMODE"))(setvar "ORTHOMODE" 1)
  (setq CE (getvar "CMDECHO"))  (setvar "CMDECHO" 0)
  (setq BM (getvar "BLIPMODE")) (setvar "BLIPMODE" 0)
  (while (= SP nil) (setq SP
    (getpoint "\nPick Start Point of Insulation (Ortho  ON; O/S  Near):  ")))
  (while (= EP nil) (setq EP
    (getpoint SP "\nPick Ending Point of Insulation:  ")))
  (os:off)
  (while (= ht nil)
     (setq ht (getdist EP "\nPick or Enter Height of Insulation: ")))
  (if (and sp ep ht)
    (progn
  (setq CLYR (getvar"CLAYER"))
  (command".LAYER""M""INSULATION""C""8""""")
  (setq AN (angle SP EP)
        DX (distance SP EP)
        NX (/ HT 2)
        NU (/ DX NX)
        NX (/ HT 2)
        AX (+ AN (/ PI 2))
        PX (polar SP AX HT)
        P1 (polar SP AX (/ HT 1.25))
        P2 (polar P1 AN (/ HT 20))
        P3 (polar P1 AN (/ HT 4))
        P4 (polar P2 AN (/ HT 2.5))
        P5 (polar SP AX (/ HT 5))
        P6 (polar P5 AN (/ HT 5))
        P7 (polar P6 AN (/ HT 10))
        P8 (polar P5 AN (/ HT 2))
        P9 (polar SP AN (/ HT 2))
  )
  (setq SLST (ssadd))
  (repeat (fix NU)
    (command ".ARC" "C" P5 SP P6)
    (setq SLST (ssadd (entlast) SLST))
    (command ".LINE" P6 P2 "" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".ARC" P2 "C" P3 "A" "-180" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".LINE" P4 P7 "" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".ARC" "C" P8 P7 P9)
    (setq SLST (ssadd (entlast) SLST))
    (setq SP (polar SP AN NX)
          P2 (polar P2 AN NX)
          P3 (polar P3 AN NX)
          P4 (polar P4 AN NX)
          P5 (polar P5 AN NX)
          P6 (polar P6 AN NX)
          P7 (polar P7 AN NX)
          P8 (polar P8 AN NX)
          P9 (polar P9 AN NX)
    )
  )

  (setq XT (distance SP EP))
  (if (>= XT (/ HT 5))
  (progn
    (command ".ARC" "C" P5 SP P6 )
    (setq SLST (ssadd (entlast) SLST))
    (command ".LINE" P6 P2 "" )
    (setq SLST (ssadd (entlast) SLST))
    (command ".ARC" P2 "C" P3 "A" "-75")
    (setq SLST (ssadd (entlast) SLST))
  )); end if
  (command ".PEDIT" "L" "Y" "J" SLST "" "")
  (initget "Yes No")
  (setq ans (getkword "Mirror Insulation? <No> "))
  (if (= ans "Yes")
    (command ".mirror" "L" "" sp ep "Y")
  )
  )); endif (and sp ep pt)
  (*error* "")
 
);end
(princ)
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.

Robb

  • Guest
Insulation Hatch?
« Reply #3 on: December 08, 2004, 06:13:35 PM »
Thanks guys it works great!  :D

whdjr

  • Guest
Insulation Hatch?
« Reply #4 on: December 09, 2004, 10:24:48 AM »
I have one VERY similar to those two, but the plines do not join.  Do the ones you guys have join?

42

  • Bull Frog
  • Posts: 483
Insulation Hatch?
« Reply #5 on: December 09, 2004, 10:31:22 AM »
Yes
Alastair Mallett Autodesk Certified Professional
Technical Director
Hunters South Architects

jwisherd

  • Guest
Insulation Hatch?
« Reply #6 on: December 09, 2004, 10:58:59 AM »
iN ACAD 2002/adt there is also a line type that is for batt insulation, you adjust the size of the batting by changing the ltscale. We have found it to be quite usefull.

whdjr

  • Guest
Insulation Hatch?
« Reply #7 on: December 09, 2004, 11:10:07 AM »
Yeah if you like the line sticking out both ends.  Plus you can't select the edges of the batting you have to select it in the center where the "line" would theoreticly be.  I didn't like it.  My 2 cents.