Please help me on this lisp program
Code:
; filename tee.lsp
;This prompts you for Dimensions as per Iplex catalogue
;then draws a Tee pn1 equal and uequal branch
;written by Donald Christensen 7/march/2007
(defun c:tee ()
(graphscr)
;
; promp for input
;
(setq hDN(getdist"\nHeader DN? "))
(setq dDN(getdist"\nBranch DN? "))
(setq b(getdist"\nHeader Length B? "))
(setq h(getdist"\nBranch Length H? "))
;
;Below is wrong. I copied it from another program I wrote before.
;I haven't written lisp for 12 years. I was a newbie then, now I know even less
;I included it because this is the simple structure I understood then
;and may jog memories as I learn lisp again
;
;
;
(setq radd(list(*(car wth)2)(*(cadr wth)2)))
(setq a(list(-(car orrigin)(/ ht 2))(-(cadr orrigin)(/ wth 2))))
(setq b(list(+(car p1)ht)(cadr p1)))
(setq c(list(car p2)(+(cadr p2)wth)))
(setq d(list(-(car p3)ht)(cadr p3)))
;
(setq e(list(+(+(car p1)wt)wt)(cadr p1)))
(setq f(list(car p1)(+(+(cadr p1)wt)wt)))
(setq g(list(-(-(car p2)wt)wt)(cadr p2)))
(setq h(list(car p2)(+(+(cadr p2)wt)wt)))
(COMMAND "_pline" o1 "A" "ce" c1 o2 "l" o3 "a" "ce" c2 o4 "l" o5 "a" "ce" c3 o6 "l" o7 "a" "ce" c4 o8 "l" o1 "")
(COMMAND "_pline" i1 "A" "ce" c1 i2 "l" i3 "a" "ce" c2 i4 "l" i5 "a" "ce" c3 i6 "l" i7 "a" "ce" c4 i8 "l" i1 "")
This is sintax is wrong but describes what I want to do
if hDN = 80 then hDIA = 99
if hDN = 100 then hDIA = 122
if hDN = 125 then hDIA = 140
if hDN = 150 then hDIA = 177
if bDN = 80 then bDIA = 99
if bDN = 100 then bDIA = 122
if bDN = 125 then bDIA = 140
if bDN = 150 then bDIA = 177
;I know this repeats and it is sloppy but it is easy to follow
set layer defpoints color 55
line cl1, cl2
line cl3 0,0
set layer o color bylayer
pline a, b, c, d, e, f
pline 0,0 f,g, h, a, 0,0
)
tee.dwg
Sorry for posting so often with so many questions
I'm in panic mode because I'm learning Autocad again.
I'm at work and feel clumbsy with this version
It's so different to a version I'm familure with
I'm trying to do 2 things
1. draw blocks (this lisp program)
2. customize Autocad
Bookmarks