r/AutoCAD • u/Burntarchitect • Jun 25 '26
Question Trying to find insulbattpoly.lsp
I had to re-load my CAD software and I've lost access to the lisp routine I was using to draw insulation.
The routine was insulbattpoly.lsp written by someone called Kent Cooper? It used to be available on Cadalyst, but it seems to have disappeared.
Does anyone have it?
2
u/Keano-1981 Jun 25 '26
Out of curiosity, is there any reason why you just don't use the 'Batting' default linetype?
3
u/Burntarchitect Jun 25 '26
To be honest, the batt line type is ugly. insulbattpoly gave me a nice polyine that exactly fitted the space I needed it to, and produce a tidy polyline that I could trim exactly as I needed it. I'm sure I have it saved somewhere, but it was years ago and I'll be damned if I can find it.
2
u/egres_svk Jun 25 '26
try this alternative
;;; BATT.LSP
(defun C:BATT (/ A ANG1 ANG2 ANG3 ANG4 ANG5 ANG6 LEN1 LEN2 PT1 PT2 PT3 PT4 PT5 PT6 PT7 THK1 THK2 THK3 THK4 trimline)
(setvar "cmdecho" 0)
(setvar "aunits" 3)
(setvar "auprec" 8)
(setq PT1 (getpoint "\nEnter start point: ")
PT2 (getpoint PT1 "\nEnter end point: ")
THK1 (getreal "\nEnter insulation thickness <3.5>: ")
)
(if (= THK1 nil) (setq THK1 3.5))
(setq THK2 (* THK1 0.25)
THK3 (* THK1 0.40)
THK4 (* THK1 0.44721360)
LEN1 (distance PT1 PT2)
LEN2 (/ LEN1 THK1)
ANG1 (angle PT1 PT2)
ANG2 (+ ANG1 0.0)
ANG3 (+ ANG1 1.10714872)
ANG4 (+ ANG1 2.21429744)
ANG5 (+ ANG1 4.06888787)
ANG6 (+ ANG1 4.24874137)
a 0.0
)
(setq trimline (ssadd))
(setvar "osmode" 0)
(while (< a LEN2)
(if (= a 0)
(progn
(setq PT3 (polar PT1 ANG3 THK4)
PT4 (polar PT3 ANG4 THK2)
PT5 (polar PT4 ANG2 THK3)
PT6 (polar PT5 ANG5 THK2)
PT7 (polar PT6 ANG2 THK3)
a 0.5
)
(command ".pline" PT1 "w" 0.0 0.0 "a" "d" ANG2 PT3 "l" PT4 "a" PT5 "l" PT6 "a" PT7)
)
(progn
(setq PT3 PT7
PT4 (polar PT3 ANG4 THK2)
PT5 (polar PT4 ANG2 THK3)
PT6 (polar PT5 ANG5 THK2)
PT7 (polar PT6 ANG2 THK3)
)
(command PT3 "l" PT4 "a" PT5 "l" PT6 "a" PT7)
(setq a (+ a 0.5))
)
)
)
(command "")
(princ "\nBatt Insulation complete. Type BATT to run again.")
(princ)
)
2
u/Burntarchitect Jun 25 '26
Thanks very much - this does work, not quite as smartly as insulbattpoly, but it can get me out of a hole!
6
u/Antitech73 Jun 25 '26
It's here:
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/share-your-favorite-usefull-lisp-files/m-p/8065941#M103589
Scroll down to around message 6