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

Mullion/Muntin Routine

37 views
Skip to first unread message

OhioCad

unread,
Jun 17, 2004, 1:40:30 PM6/17/04
to
Trying to make it quicker to draw storefronts. I have a little basic autolisp knowledge (just enough to be dangerous) What is the best way to select a rectangle and draw a horizontal line across the top and bottom a specified width from the top and bottom sides of the rectangle? From there I think I can extrapolate and modify the routine to draw the rest of it.

Rudy Tovar

unread,
Jun 17, 2004, 1:46:26 PM6/17/04
to
Try MASi...or see the quick example I created some time ago, below.
--
Ru...@Cadentity.com
AUTODESK
Authorized Developer
http://www.Cadentity.com
MASi

(defun c:Mu (/ ts tl pt1 pt2 an1 an2 di1 m1 m2 m3 m4 g1 g2 g3 g4 di2)
(setq ts (getvar "osmode"))
(setvar "osmode" ts)
(setq tl (getvar "clayer"))
(setvar "clayer" tl)
(setvar "osmode" 1)

(setq pt1 (getpoint "\nPick First Side point: "))

(if pt1
(progn
(setq pt2 (getpoint pt1 "\nPick Second Side point: "))

(if pt2
(setq pt3 (getpoint pt2 "\nPick Opposite side of wall: "))
)

(if (and pt1 pt2 pt3)
(progn
(setvar "osmode" 0)
(setq an1 (angle pt1 pt2))
(setq an2 (angle pt2 pt3))
(setq di1 (distance pt2 pt3))
(setq pt4 (polar pt1 an2 di1))
(setq m1 (polar pt1 an1 2))
(setq m2 (polar pt2 (+ an1 (dtr 180)) 2))
(setq m3 (polar m2 an2 di1))
(setq m4 (polar m1 an2 di1))
(setq di2 (- (/ di1 2)0.5))
(setq g1 (polar m1 an2 di2))
(setq g2 (polar m2 an2 di2))
(setq g3 (polar g2 an2 1))
(setq g4 (polar g1 an2 1))

(if (tblsearch "layer" "win")(setvar "clayer" "win"))

(command "pline" pt1 m1 m4 pt4 "c")
(command "pline" pt2 pt3 m3 m2 "c")
(command "pline" g1 g2 g3 g4 "c")
(command "line" m1 m2 "")
(command "line" m3 m4 "")
)
)


)
)

(setvar "osmode" ts)
(setvar "clayer" tl)
(if pt1 (c:mu))
(princ)
)
"OhioCad" <nos...@address.withheld> wrote in message
news:13981018.108749406...@jiveforum2.autodesk.com...

OhioCad

unread,
Jun 17, 2004, 2:51:47 PM6/17/04
to
Tried to cut and paste that code into wordpad, resaved as mu.lsp
Did appload and it said successfully loaded and then bad character read (octal)
Checked it again and it seems like I got all the parenthesis. Using Autocad 2000i if that makes a difference.

OhioCad

unread,
Jun 17, 2004, 3:02:08 PM6/17/04
to
That looks a little more extensive than I would need, but essentially yes. Usually just a single tenant storefront with 1 or 2 intermediate horizontals and a single door.

GaryDF

unread,
Jun 17, 2004, 3:26:38 PM6/17/04
to
Ok, here is the guts of the elevation routine...you will need to modify it
to meet your needs.

If you need more help, I can make a standalone version over the weekend.
The routine I have is from a larger program...will take time to seperate
out just the storefront-curtain routine from my arch program.


Gary

;;;some variables to set:
(setq elheight 144)
(if (not fwidth) (setq fwidth 2.0))
(if (not fdepth) (setq fdepth 4.5))

(if (not levels)
(setq levels 1)
)

;;;points to be set:
(setq
a (getpoint
"\n* Pick Starting point of Curtain Wall <Left Point> *"
)
)
(setq c
(getpoint a
"\n* Pick End point of Curtain Wall <Right Point> --> *"
)
)
(command ".snap" "r" a c)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; Storefront Elevation Function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
(defun draw_swall ()
;;(cond ((= ARCH#CLAY "Off")(ARCH:LYR "A-GLAZ-MULL")))
(princ "\n* Drawing Storefront Wall in Elevation *")
(setvar "osmode" 0)
(setq num_jambs (+ divisions 1)
total_panel_size
(- clength (* num_jambs fwidth))
actual_panel_size
(/ total_panel_size divisions)
)
(setq start a)
(setq b (polar a (angle a b) elheight))
(setq d (polar b (angle a c) clength))
(setq aa (list (car a) (- (cadr a) fwidth)))
(setq cc (list (car c) (- (cadr c) fwidth)))
(setq bb (list (car b) (+ (cadr b) fwidth)))
(setq dd (list (car d) (+ (cadr d) fwidth)))
(setq ss (ssadd))
(command "line" a c "")
(setq ss (ssadd (entlast) ss))
(command "line" b d "")
(setq ss (ssadd (entlast) ss))
(setq j1 start)
(setq j4 (polar j1 (angle start b) fwidth))
(setq jj4 (list (car j1) (+ (cadr j4) fwidth)))
(command "line" j4 jj4 "")
(setq ss (ssadd (entlast) ss))
(setq jj5 (list (car j1) (- (cadr j1) elheight)))
(setq jj6 (list (car j1) (+ (cadr jj5) fwidth)))
(command "line" jj5 jj6 "")
(setq ss (ssadd (entlast) ss))
(repeat divisions
(setq j1 start)
(setq j2 (polar j1 (angle a c) fwidth))
(setq j3 (polar j2 (angle a b) elheight))
(setq j4 (polar j3 (angle c a) fwidth))
(setq m1 (list (car j1) (+ (cadr j4) ght1)))
(setq m2 (list (car j2) (+ (cadr j3) ght1)))
(setq j5 (polar m2 (angle start c) actual_panel_size))
(setq m11 (list (car j1) (+ (cadr j4) ght2)))
(setq m22 (list (car j2) (+ (cadr j3) ght2)))
(setq j55 (polar m22 (angle start c) actual_panel_size))
(setq j1 (list (car j1) (- (cadr j1) fwidth)))
(setq j2 (list (car j2) (- (cadr j2) fwidth)))
(setq j3 (list (car j3) (+ (cadr j3) fwidth)))
(setq j4 (list (car j4) (+ (cadr j4) fwidth)))
(command "line" j1 j4 "")
(setq ss (ssadd (entlast) ss))
(command "line" j2 j3 "")
(setq ss (ssadd (entlast) ss))
(setq jj1 (list (+ (car j1) fwidth) (cadr j1)))
(setq jj2 (polar j1 (angle start c) (+ actual_panel_size fwidth)))
(setq jj4 (polar j4 (angle start c) (+ actual_panel_size fwidth)))
(command "line" jj1 jj2 "")
(setq ss (ssadd (entlast) ss))
(command "line" j3 jj4 "")
(setq ss (ssadd (entlast) ss))
(setq x2 (list (car j3) (+ (cadr j3) (- ght1 fwidth))))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq ss (ssadd (entlast) ss))
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq ss (ssadd (entlast) ss))
(cond
((/= ght2 0)
(progn
(setq x2 (list (car j3) (+ (cadr j3) (- ght2 fwidth))))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq ss (ssadd (entlast) ss))
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq ss (ssadd (entlast) ss))
)
)
)
(setq
start (polar start (angle a c) (+ actual_panel_size fwidth))
)
)
(setq j1 (polar j2 (angle a c) actual_panel_size))
(setq j1 start)
(setq j2 (polar j1 (angle a c) fwidth))
(setq j3 (polar j2 (angle a b) elheight))
(setq j4 (polar j3 (angle c a) fwidth))
(setq j1 (list (car j1) (- (cadr j1) fwidth)))
(setq j2 (list (car j2) (- (cadr j2) fwidth)))
(setq j3 (list (car j3) (+ (cadr j3) fwidth)))
(setq j4 (list (car j4) (+ (cadr j4) fwidth)))
(command "line" j1 j4 "")
(setq ss (ssadd (entlast) ss))
(command "line" j2 j3 "")
(setq ss (ssadd (entlast) ss))
(setq x2 (list (car j2) (+ (- (cadr j2) elheight) fwidth)))
(setq x3 (list (car j3) (cadr j3)))
(command "line" x2 x3 "")
(setq ss (ssadd (entlast) ss))
(setq x2 (list (car j2) (+ (cadr j2) fwidth)))
(setq x3 (list (car j3) (- (+ (cadr j3) elheight) (* fwidth 2))))
(command "line" x2 x3 "")
(setq ss (ssadd (entlast) ss))
(createblock-elev ss a)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;; Curtainwall Elevation Function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
(defun draw_cwall ()
;;(cond ((= ARCH#CLAY "Off")(ARCH:LYR "A-GLAZ-MULL")))
(princ "\n* Drawing Curtainwall in Elevation *")
(setq elheight (atoi (rtos (+ (* (- levels 1) flrheight) ght2) 2 0)))
(setvar "osmode" 0)
(setq num_jambs (+ divisions 1)
total_panel_size
(- clength (* num_jambs fwidth))
actual_panel_size
(/ total_panel_size divisions)
)
(setq start a)
(setq b (polar a (angle a b) elheight))
(setq d (polar b (angle a c) clength))
(setq aa (list (car a) (- (cadr a) fwidth)))
(setq cc (list (car c) (- (cadr c) fwidth)))
(setq bb (list (car b) (+ (cadr b) fwidth)))
(setq dd (list (car d) (+ (cadr d) fwidth)))
(setq ss (ssadd))
(command "line" a c "")
(setq ss (ssadd (entlast) ss))
(command "line" b d "")
(setq ss (ssadd (entlast) ss))
(setq j1 start)
(setq j4 (polar j1 (angle start b) fwidth))
(setq jj1 (list (car j1) (- (cadr j1) elheight)))
(setq jj4 (list (car j1) (+ (cadr j4) fwidth)))
(command "line" j4 jj4 "")
(setq ss (ssadd (entlast) ss))
(setq jj5 (list (car j1) (- (cadr j1) elheight)))
(setq jj6 (list (car j1) (+ (cadr jj5) fwidth)))
(command "line" jj5 jj6 "")
(setq ss (ssadd (entlast) ss))
(repeat divisions
(setq j1 start)
(setq j2 (polar j1 (angle a c) fwidth))
(setq j3 (polar j2 (angle a b) elheight))
(setq j4 (polar j3 (angle c a) fwidth))
(setq m1 (list (car j1) (+ (cadr j4) ght1)))
(setq m2 (list (car j2) (+ (cadr j3) ght1)))
(setq j5 (polar m2 (angle start c) actual_panel_size))
(setq m11 (list (car j1) (+ (cadr j4) ght2)))
(setq m22 (list (car j2) (+ (cadr j3) ght2)))
(setq j55 (polar m22 (angle start c) actual_panel_size))
(setq j1 (list (car j1) (- (cadr j1) fwidth)))
(setq j2 (list (car j2) (- (cadr j2) fwidth)))
(setq j3 (list (car j3) (+ (cadr j3) fwidth)))
(setq j4 (list (car j4) (+ (cadr j4) fwidth)))
(command "line" j1 j4 "")
(setq ss (ssadd (entlast) ss))
(command "line" j2 j3 "")
(setq ss (ssadd (entlast) ss))
(setq jj1 (list (+ (car j1) fwidth) (cadr j1)))
(setq jj2 (polar j1 (angle start c) (+ actual_panel_size fwidth)))
(setq jj4 (polar j4 (angle start c) (+ actual_panel_size fwidth)))
(command "line" jj1 jj2 "")
(setq ss (ssadd (entlast) ss))
(command "line" j3 jj4 "")
(setq ss (ssadd (entlast) ss))
(cond
((= levels 2)
(progn
(setq x2 (list (car j3) (+ (cadr j3) flrheight)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq x2 (list (car j3) (+ (cadr j3) (- ght1 fwidth))))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos levels 2 0)
"1"
flrheight
)

(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos levels 2 0)
"1"
flrheight
)

(setq x2 (list (car j3) (+ (cadr j3) (- ght2 fwidth))))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
)
)
((> levels 2)
(progn
(setq x2 (list (car j3) (+ (cadr j3) flrheight)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos (- levels 1) 2 0)
"1"
flrheight
)
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos (- levels 1) 2 0)
"1"
flrheight
)
(setq x2 (list (car j3) (+ (cadr j3) (- ght1 fwidth))))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos levels 2 0)
"1"
flrheight
)
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos levels 2 0)
"1"
flrheight
)
(setq x2 (list (car j3) (+ (cadr j3) (- ght2 fwidth))))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos (- levels 1) 2 0)
"1"
flrheight
)
(setq x2 (list (car x2) (- (cadr x2) fwidth)))
(setq x3 (polar x2 (angle start c) actual_panel_size))
(command "line" x2 x3 "")
(command "array"
(entlast)
""
"r"
(rtos (- levels 1) 2 0)
"1"
flrheight
)
)
)
)
(setq
start (polar start (angle a c) (+ actual_panel_size fwidth))
)
)
(setq j1 (polar j2 (angle a c) actual_panel_size))
(setq j1 start)
(setq j2 (polar j1 (angle a c) fwidth))
(setq j3 (polar j2 (angle a b) elheight))
(setq j4 (polar j3 (angle c a) fwidth))
(setq j1 (list (car j1) (- (cadr j1) fwidth)))
(setq j2 (list (car j2) (- (cadr j2) fwidth)))
(setq j3 (list (car j3) (+ (cadr j3) fwidth)))
(setq j4 (list (car j4) (+ (cadr j4) fwidth)))
(command "line" j1 j4 "")
(setq ss (ssadd (entlast) ss))
(command "line" j2 j3 "")
(setq ss (ssadd (entlast) ss))
(setq j2 (list (car j2) (+ (cadr j2) fwidth)))
(setq j3 (list (car j3) (- (cadr j3) fwidth)))
(command "line" j2 j3 "")
(setq ss (ssadd (entlast) ss))
(createblock-elev ss a)
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Create Block Function
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
(defun createblock-elev (sset pt /)
;;(cond ((= ARCH#CLAY "Off")(ARCH:LYR "A-GLAZ-MULL")))
(entmake
(list '(0 . "BLOCK")
'(2 . "*anon")
'(70 . 1)
(cons '10 pt)
)
)
(setq aa 0)
(repeat (sslength sset)
(progn
(entmake (entget (setq ent (ssname sset aa))))
(if (assoc 66 (entget ent))
(progn
(setq subent (entnext ent))
(while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
(entmake (entget subent))
(setq subent (entnext subent))
)
(entmake (entget subent))
)
)
(entdel ent)
)
(setq aa (1+ aa))
)
;;write block end sub-entity
;;(cond ((= ARCH#CLAY "Off")(ARCH:LYR "A-GLAZ-MULL")))
(setq name (entmake '((0 . "endblk"))))
(entmake
(list '(0 . "INSERT")
(cons '2 name)
(cons '10 pt)
)
)
(setq sset nil)
(princ)
)
;;;
(defun createblock-plan (sset pt /)
;;(cond ((= ARCH#CLAY "Off")(ARCH:LYR "A-GLAZ-MULL")))
(entmake
(list '(0 . "BLOCK")
'(2 . "*anon")
'(70 . 1)
(cons '10 pt)
)
)
(setq aa 0)
(repeat (sslength sset)
(progn
(entmake (entget (setq ent (ssname sset aa))))
(if (assoc 66 (entget ent))
(progn
(setq subent (entnext ent))
(while (/= (cdr (assoc 0 (entget subent))) "SEQEND")
(entmake (entget subent))
(setq subent (entnext subent))
)
(entmake (entget subent))
)
)
(entdel ent)
)
(setq aa (1+ aa))
)
;;write block end sub-entity
;;(cond ((= ARCH#CLAY "Off")(ARCH:LYR "A-GLAZ")))
(setq name (entmake '((0 . "endblk"))))
(entmake
(list '(0 . "INSERT")
(cons '2 name)
(cons '10 pt)
)
)
(setq sset nil)
(princ)
)
;;;
(defun mid (xx yy)
(list (/ (+ (car xx) (car yy)) 2)
(/ (+ (cadr xx) (cadr yy)) 2)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
(princ)


"OhioCad" <nos...@address.withheld> wrote in message

news:21303483.1087498959365.JavaMail.jive@jiveforum2...

Rudy Tovar

unread,
Jun 17, 2004, 5:03:32 PM6/17/04
to
Just curious, but have you ever done tilt-ups?

--
Ru...@Cadentity.com
AUTODESK
Authorized Developer
http://www.Cadentity.com
MASi

"OhioCad" <nos...@address.withheld> wrote in message
news:21303483.1087498959365.JavaMail.jive@jiveforum2...

OhioCad

unread,
Jun 17, 2004, 10:17:44 PM6/17/04
to
When I envisioned writing a routine on my on I figured on getting the opening coordinates with a pick window, entering # of panels and width of mullions. Then drawing a basic storefront based on that information. For the extent of what I need, a 5 panel storefront would require 2 horizontal lines and 10 vertical lines (not counting the intitial rectangle drawn from the pick window location). Then extra horizontal dividers if I want to get fancy. I can drop in a door block after. For the previous inquiry about tilt-ups, I have done a little drafting in that regard. Most of my initial experience was architectural drafting for Sea World, Petco, Military Bases. Then went on to focus on electrical drafting and design for Petco, Taco Bell, Qwest, At&T among others...I spend my time now working mainly Dunkin' Donut stores for an Architect in Chicago...Helping in all areas of the process including Architectural, Mechanical and Electrical. Design as well as drafting.

Daniel

unread,
Jun 18, 2004, 12:23:55 PM6/18/04
to
Hey Gary I am interested more in this lisp routine for storefronts.
I copied and paste into noted pad and saved it as a lsp file, now how do I
get it to work?
It lets me set my left point and right point but thats it am I missing
something?
I know very little in lisp.

thanks,

daniel


"GaryDF" <fow...@architettura-inc.com> wrote in message
news:40d1f0a8_1@newsprd01...

GaryDF

unread,
Jun 18, 2004, 2:06:03 PM6/18/04
to
I will make a standalone version over the weekend and post to the group.
The routine is buried deep within my arch program, and I will need to separate it
out.

I will have it by Monday

Gary

"Daniel" <cad12m at yahoo dot com> wrote in message news:40d31641_2@newsprd01...

Daniel

unread,
Jun 18, 2004, 5:50:32 PM6/18/04
to
Thanks Gary.

daniel

"GaryDF" <fow...@architettura-inc.com> wrote in message

news:40d331a6_3@newsprd01...
> This is what it will do for a storefront in elevation.
>
>
>
> You can program the storefront with input to the dialog box.
>
>
>
> Frame width = 2"
>
> Number of panels = 4
>
> Panel width = 2'-9 ½"
>
>
>
>
>
> overall height = 12'-0"
>
> height of top intermediate mullion = 9'-0"
>
> height of bottom intermediate mullion = 2'-6"


>
>
>
>
>
>
>
>
>
>
>
> "GaryDF" <fow...@architettura-inc.com> wrote in message

> news:40d32f46_2@newsprd01...

Daniel

unread,
Jun 21, 2004, 10:14:51 AM6/21/04
to
Gary,
Much Thanks

Daniel

"GaryDF" <fow...@architettura-inc.com> wrote in message

news:40d6d780_1@newsprd01...
> Here is the curtainwall-storefront routine.


>
> Gary
>
>
> "Daniel" <cad12m at yahoo dot com> wrote in message

> news:40d362cd$1_3@newsprd01...

GaryDF

unread,
Jun 21, 2004, 10:31:26 AM6/21/04
to
Your welcome...I still need to do some error checking.
Found one problem that I need to fix. Will have it repaired soon.

Also the dialog box will rember the last screen position, whenever the
exit button is entered.

Gary

"Daniel" <cad12m at yahoo dot com> wrote in message news:40d6ec87_1@newsprd01...

filome...@gmail.com

unread,
Sep 20, 2014, 7:06:53 PM9/20/14
to
0 new messages