Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Insulation Batt Lisp.......Anyone?

273 views
Skip to first unread message

Marc Johnson

unread,
Apr 10, 2002, 8:44:09 AM4/10/02
to
I have had a request from a colleague for a function to do the following:-

Inserting Insulation batts, pick insertion point 1, pick second point to
determine length of batt, then function will ask for the thickness required,
a line of insulation is inserted at the desired length and thickness.

Does anyone have a lisp routine that does this, or something similar?

I would have a go, but my lisp knowledge is limited, and it seems out of my
depth.

Thanks in advance for any responses!

Cheers

Marc Johnson


CJ Follmer

unread,
Apr 10, 2002, 12:27:05 PM4/10/02
to
Here's one I use.


;;; BATT.LSP
;;; Origianlly by David Sides
;;; Modified by CJ follmer

(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 (Left to Right) ")
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.40000000)
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
)
(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 "")
(command ".line" pt2 (polar pt2 (+ ANG1 (dgtr 90)) THK1) "")
(ssadd (entlast) trimline)
(command ".trim" trimline "" pt7 "")
(command ".erase" trimline "")
(princ)
) ;end defun

(princ "\nBatt Insulation. Type BATT. ")
(princ)

"Marc Johnson" <mjoh...@ryders.com> wrote in message
news:4D4726801551189B...@in.WebX.maYIadrTaRb...

Beau Turner

unread,
Apr 11, 2002, 11:03:47 AM4/11/02
to
Here is the one I use, it is a slightly modified version of CJ's posted
above. There are a few differences. The insulation is placed on the layer
a-sect-patt, also stores current layer, osmode, cmdecho, aunits & auprec and
replaces them back when the routine is finished.

Hope this helps,
Beau

;;; Insulation.LSP
;;; Original by David Sides
;;; Modified by CJ follmer
;;; Latest Update by Beau Turner 01/02/02
;;; Version 1.2 - Added rubber band line to ouline picked points
;
(defun C:insulation (/ olayer oosmode ocmdecho oaunits oauprec A ANG1 ANG2


ANG3 ANG4 ANG5 ANG6 LEN1 LEN2 PT1 PT2 PT3 PT4 PT5 PT6 PT7 THK1 THK2 THK3
THK4 trimline)

(setq olayer (getvar "clayer"))
(setq oosmode (getvar "osmode"))
(setq ocmdecho (getvar "cmdecho"))
(setq oaunits (getvar "aunits"))
(setq oauprec (getvar "auprec"))
(if (not (tblsearch "layer" "A-Sect-Patt"))
(progn
(command".LAYER""M""A-Sect-Patt""C""1""""")
)
)
(setvar "clayer" "A-Sect-Patt")


(setvar "cmdecho" 0)
(setvar "aunits" 3)
(setvar "auprec" 8)

(defun dgtr (a) ;(dgtr <degree value>)
(* pi (/ a 180.0))
)
(setq PT1 (getpoint "\nPick or Enter start point (Top) ")
PT2 (getpoint PT1 "\nPick or Enter end point (Bottom). ")
THK1(getdist PT2 "\nPick or Enter insulation thickness. <3.5\">")

(setvar "clayer" olayer)
(setvar "osmode" oosmode)
(setvar "cmdecho" ocmdecho)
(setvar "aunits" oaunits)
(setvar "auprec" oauprec)
(princ)
) ;end defun

(princ)


"Marc Johnson" <mjoh...@ryders.com> wrote in message
news:4D4726801551189B...@in.WebX.maYIadrTaRb...

Jeff White

unread,
Apr 12, 2002, 4:59:01 PM4/12/02
to
Do you use the BATT linetype? I have a program where you draw a line at
the center of the insulation batt, run my program which allows you to
input the batt width or select 2 points to define the width. The
program then assigns the batt linetype to the line with a linetype scale
that fills the width previously determined. Send me an email if your
interested.

In article <4D4726801551189B...@in.WebX.maYIadrTaRb>,
mjoh...@ryders.com says...

0 new messages