PDA

View Full Version : creating a base storefront elevation


james.126519
2007-07-13, 02:06 AM
How difficult would it be to write a program that, when ran, asks me for "opening width", "opening height", "sightline", and "perimeter joint"... so if i entered "99", "95", "2", and "0.5" respectively, it would produce a replication of what is in the attached drawing (minus the dimensions)?

I work in the architectural aluminum industry, and have seen such a program before. it was proprietary and i was not allowed to have it. lol

if anyone could give me some help i would appreciate it.

Adesu
2007-07-13, 02:24 AM
Hi james,
I don't understand what are you said,sorry.
Are you want create dimension on it, or you want create figure as your post?.

How difficult would it be to write a program that, when ran, asks me for "opening width", "opening height", "sightline", and "perimeter joint"... so if i entered "99", "95", "2", and "0.5" respectively, it would produce a replication of what is in the attached drawing (minus the dimensions)?

I work in the architectural aluminum industry, and have seen such a program before. it was proprietary and i was not allowed to have it. lol

if anyone could give me some help i would appreciate it.

james.126519
2007-07-13, 02:39 AM
Hi james,
I don't understand what are you said,sorry.
Are you want create dimension on it, or you want create figure as your post?.

Basically, i want a program that i can input the 4 values, and it will create the picture as i have attached. i just dont want dimensions on it (yet). the dimensions on the attached elevation are just for reference to whoever is willing to help me.

thanks

Opie
2007-07-13, 05:47 AM
Good luck.

The following code has three additional prompts which you did not request. There is a prompt for the number of rows and one for the number of columns. There is also a prompt for the lower left corner.

This routine does not place any of these polylines on any particular layer. The current layer is used. There are several threads around here with which to find the code to change and/or create your desired layers.
(defun c:storefront (/ DTR HDIST HSPACE LL
LR OHEIGHT OSMD OWIDTH PJOINT
PLL PLR PUL PUR SLINE
TLL TLR TUL TUR UL
UR VDIST VSPACE RECALLPOSNUMVALUE
)
(defun recallposnumvalue (value stringprompt / temp)
(if (not (numberp value))
(setq value
(getint (strcat "\n" stringprompt ": "))
)
(progn
(initget 6)
(setq
temp (getint (strcat "\n"
stringprompt
" <"
(itoa value)
">: "
)
)
)
(if (numberp temp)
(setq value temp)
)
)
)
value
)
;;; Begin main program
(setq owidth (getdist "\nSpecify Opening Width: ")
oheight (getdist "\nSpecify Opening Height: ")
sline (getdist "\nSpecify Sight Line: ")
pjoint (getdist "\nSpecify Perimeter Joint: ")
)
(setq storefront:vspace
(recallposnumvalue
storefront:vspace
"Enter the number of rows (---)"
)
)
(setq storefront:hspace
(recallposnumvalue
storefront:hspace
"Enter the number of columns (|||)"
)
)
(setq vspace storefront:vspace)
(setq hspace storefront:hspace)
;;; utility to convert decimal degrees to radians
(defun DTR (A) (* pi (/ A 180.0)))
(setq ll (getpoint "\nSpecify lower left corner: ")
lr (polar ll 0.0 owidth)
ur (polar lr (dtr 90.0) oheight)
ul (polar ll (dtr 90.0) oheight)
)
(setq osmd (getvar "osmode"))
(setvar "osmode" 0)
;;; Draw perimeter joint
(vl-cmdf "pline" ll lr ur ul "c")
(setq pll (polar (polar ll 0.0 pjoint) (dtr 90.0) pjoint)
plr (polar pll 0.0 (- owidth (* 2.0 pjoint)))
pur (polar plr (dtr 90.0) (- oheight (* 2.0 pjoint)))
pul (polar pll (dtr 90.0) (- oheight (* 2.0 pjoint)))
)
(setq tll pll
tul pul
tlr (polar tll 0.0 sline)
tur (polar tul 0.0 sline)
)
;;; Draw vertical frame
(vl-cmdf "pline" tll tlr tur tul "c")
(setq hdist (/ (- owidth (+ (* 2.0 pjoint) sline)) (float hspace))
vdist (/ (- oheight (+ (* 2.0 pjoint) sline)) (float vspace))
)
;;; array vertical frame
(vl-cmdf "array" (entlast) "" "R" 1 (1+ hspace) hdist)
(setq tll (polar pll 0.0 sline)
tlr (polar tll 0.0 (- hdist sline))
tur (polar tlr (dtr 90.0) sline)
tul (polar tll (dtr 90.0) sline)
)
;;; draw horizontal frame
(vl-cmdf "pline" tll tlr tur tul "c")
;;; array horizontal frame
(vl-cmdf "array"
(entlast)
""
"R"
(1+ vspace)
hspace
vdist
hdist
)
(setvar "osmode" osmd)
)

If you have any difficulty with this routine, post back in here and maybe someone else can make it work for you. I am too tied up at the moment to fiddle with this any further.

james.126519
2007-07-13, 10:14 PM
Good luck.

The following code has three additional prompts which you did not request. There is a prompt for the number of rows and one for the number of columns. There is also a prompt for the lower left corner.

This routine does not place any of these polylines on any particular layer. The current layer is used. There are several threads around here with which to find the code to change and/or create your desired layers.
(defun c:storefront (/ DTR HDIST HSPACE LL
LR OHEIGHT OSMD OWIDTH PJOINT
PLL PLR PUL PUR SLINE
TLL TLR TUL TUR UL
UR VDIST VSPACE RECALLPOSNUMVALUE
)
(defun recallposnumvalue (value stringprompt / temp)
(if (not (numberp value))
(setq value
(getint (strcat "\n" stringprompt ": "))
)
(progn
(initget 6)
(setq
temp (getint (strcat "\n"
stringprompt
" <"
(itoa value)
">: "
)
)
)
(if (numberp temp)
(setq value temp)
)
)
)
value
)
;;; Begin main program
(setq owidth (getdist "\nSpecify Opening Width: ")
oheight (getdist "\nSpecify Opening Height: ")
sline (getdist "\nSpecify Sight Line: ")
pjoint (getdist "\nSpecify Perimeter Joint: ")
)
(setq storefront:vspace
(recallposnumvalue
storefront:vspace
"Enter the number of rows (---)"
)
)
(setq storefront:hspace
(recallposnumvalue
storefront:hspace
"Enter the number of columns (|||)"
)
)
(setq vspace storefront:vspace)
(setq hspace storefront:hspace)
;;; utility to convert decimal degrees to radians
(defun DTR (A) (* pi (/ A 180.0)))
(setq ll (getpoint "\nSpecify lower left corner: ")
lr (polar ll 0.0 owidth)
ur (polar lr (dtr 90.0) oheight)
ul (polar ll (dtr 90.0) oheight)
)
(setq osmd (getvar "osmode"))
(setvar "osmode" 0)
;;; Draw perimeter joint
(vl-cmdf "pline" ll lr ur ul "c")
(setq pll (polar (polar ll 0.0 pjoint) (dtr 90.0) pjoint)
plr (polar pll 0.0 (- owidth (* 2.0 pjoint)))
pur (polar plr (dtr 90.0) (- oheight (* 2.0 pjoint)))
pul (polar pll (dtr 90.0) (- oheight (* 2.0 pjoint)))
)
(setq tll pll
tul pul
tlr (polar tll 0.0 sline)
tur (polar tul 0.0 sline)
)
;;; Draw vertical frame
(vl-cmdf "pline" tll tlr tur tul "c")
(setq hdist (/ (- owidth (+ (* 2.0 pjoint) sline)) (float hspace))
vdist (/ (- oheight (+ (* 2.0 pjoint) sline)) (float vspace))
)
;;; array vertical frame
(vl-cmdf "array" (entlast) "" "R" 1 (1+ hspace) hdist)
(setq tll (polar pll 0.0 sline)
tlr (polar tll 0.0 (- hdist sline))
tur (polar tlr (dtr 90.0) sline)
tul (polar tll (dtr 90.0) sline)
)
;;; draw horizontal frame
(vl-cmdf "pline" tll tlr tur tul "c")
;;; array horizontal frame
(vl-cmdf "array"
(entlast)
""
"R"
(1+ vspace)
hspace
vdist
hdist
)
(setvar "osmode" osmd)
)

If you have any difficulty with this routine, post back in here and maybe someone else can make it work for you. I am too tied up at the moment to fiddle with this any further.

wow, thank you so much. that worked perfectly!

j_minola
2008-05-11, 04:15 PM
I need to ask a dumb question if you guys dont mind. When I copy this code do I just paste it into the command line? When I did this it does not prompt me to specify anything.. I'm doing research on this right now but any additional help would be greatly appreciated...

Thanks,

Nevermind. I read on how to make a .lsp file and save it in a folder. My next question is probally unique. Is there a way that you can program it to give me dimensions. Like outside dimensions, rough openings, daylight openings which is between the horizontal storefront where the glass would go? I think that would be really cool. Here is what I would like to automate to look like. Your help would be very awesome and greatly appreciated... Please see attached file...

'gile'
2008-05-11, 07:55 PM
Hi,

What about using dynamic blocks ?
You can inspire attached file.

j_minola
2008-05-11, 09:49 PM
Thats cool what you did but I dont think that it applies to my needs as far as dimensioning goes. Thanks though.

fixo
2008-05-14, 06:57 AM
Change this one to your suit
No explanation, sorry
Tested on your drawing


(defun suminlist (lst / d res)
(setq res (list (car lst)))
(foreach itm (cdr lst)
(setq d (car res))
(setq res (cons (+ d itm) res))
)
(reverse res)
)

(defun C:SF (/ bottomg cnt dx dx1 dx2 dy frame_height frame_width
leftg p0 p1 p2 shims subsil xlist ylist)
(setq clyr (getvar "clayer"))
(setq ccol (getvar "cecolor"))
(command "_undo" "_BE")

(setq xlist '(35.8125 35.875 36.0 35.875 35.8125));list of dimensions by X
(setq ylist '(29.125 47.625 31.625));the same by Y
(setq leftg 4.5
bottomg 4.5
subsil 0.375
shims 0.375 )

(setq xlist (append (list leftg) xlist))
(setq xlist (apply 'append
(mapcar
(function (lambda (x)
(list x 2.0)))
xlist))
)
(setq xlist (append (list 0.0) xlist))
(princ (apply '+ xlist))
(setq ylist (append (list bottomg) ylist))
(setq cnt 0)
(setq ylist (apply 'append
(mapcar
(function (lambda (x)
(setq cnt (1+ cnt))
(if (/= cnt 1)(list x 2.0) (list x))))
ylist))
)

(setq ylist (append (list (- (+ shims subsil))(- subsil) 0.0) ylist))
(vl-remove (nth 4 ylist) ylist)
(setq frame_width (getdist "\nEnter frame width [used 196.0]: "))
(setq frame_height (getdist "\nEnter frame height [used 118.875]: "))
(setvar "clayer" "B-THIN")
(setvar "cecolor" "256")

(setq p0 (getpoint "\nLower left point of frame: "))
(setq top1 (mapcar '+ p0 (list 0.0 frame_height 0.0 ))
top2 (mapcar '+ p0 (list frame_width frame_height 0.0))
)
(mapcar (function (lambda (x)
(setq p1 (mapcar '+ p0 (list 0.0 x 0.0))
p2 (mapcar '+ p1 (list frame_width 0.0 0.0)))
(command "_.line" "_none" p1 "_none" p2 "")))
(list (car ylist)(cadr ylist)(caddr ylist)))

(setvar "clayer" "FRAME")

(mapcar (function (lambda(x)(command "_.line"
"_none"
(setq p1 (mapcar '+ p1 (list x 0.0 0.0)))
"_none"
(mapcar '+ p1 (list 0.0 frame_height 0.0)) "")
)
)
xlist
)
(setq xlist (suminlist xlist))

(setq xlist (reverse (cdr (reverse (cdddr xlist)))))
(setq xlist (append (list 6.5) xlist))

(setq p0 (mapcar '+ p0 (list 0.0 (caddr ylist) 0.0)))
(while (cadr xlist)
(setq dx1 (car xlist)
dx2 (cadr xlist)
)
(mapcar (function (lambda(x)
(command "_.line" "_none"
(mapcar '+ p0 (list dx1 x 0.0))
"_none"
(mapcar '+ p0 (list dx2 x 0.0)) "")
)
)

(suminlist (reverse (cdr (reverse (cddr ylist)))))
)
(setq xlist (cddr xlist))
)
(command "_.line" "_none"
top1 "_none"
top2 "")
(setvar "clayer" clyr)
(setvar "cecolor" ccol)
(command "_undo" "_E")
(princ)
)


~'J'~