;; This is a specialised Railing Routine
;; CAB - Jan. 3,2010 to present
;; This version uses Plines & Hatches, previous version used Wipeouts
;; Creates an elevation view of 2X Pressure Treated Lumber Hand Rail System
;; Pickets do not touch the deck below
;; Rails are made of 2x4 lumber
;; Rail Cap is made of 2x6 lumber
;; Pickets are made of 2x2 lumber
;; Note: actual lumber sizes are -.5"
(defun c:Railing
(/ ang clr count deflayer dis gap ht lst norm obj p1 p2 pll spc step tmp
whole wid y1 y2 y3 y4 y5 rail1 rail2 hLayer)
(defun mkhatch
(spc obj lst lay
/ hatch spc
) )
)
;; http://lee-mac.com/draworderfunctions.html
)
;; by CAB 03/22/2009 - modified too close pline
;; Expects pts to be a list of 2D or 3D points
;; Returns new pline object
(defun makePline
(spc pts lay
/ norm elv pline
) )
pts)))
)
pline
)
;; width of pattern 7.5 center of one picket to the center of next.
;; width of picket is 1.5
(setq defLayer
"zDtl Light 5" ; picket layer rail1 "zDtl Medium 5"
rail2 "zDtl Medium 4"
hLayer "WipeOut"
wid 1.5 ; picket width
ht 37.0 ; picket height
spc 3.5 ; space between pickets (max < 4.0")
clr 1.625 ; picket clearance from deck
y1 3.5 ; height of rail lines
y2 7.0 ; y1-y2 are botton rail
y3 37.0 ; y3-y4 are top rail
y4 40.5 ; y4-y5 are rail cap
y5 42.0
)
)
(if (< (car p2
)(car p1
)) (setq tmp p1 p1 p2 p2 tmp
)) ; make p1-p2 left to right
dis (+ wid (* (+ wid spc) whole))
pll
(polar (polar p1 ang gap
) (+ ang
(/ pi
2)) clr
) ; LowerLeft of 1st picket )
)
)
(setq lst
(list(up p1 ang y4
)(up p2 ang y4
)(up p2 ang y3
)(up p1 ang y3
))) (setq obj
(makePline spc lst defLayer
)) (mkhatch spc obj lst hLayer)
(setq lst
(list(up p1 ang y5
)(up p2 ang y5
)(up p2 ang y4
)(up p1 ang y4
))) (setq obj
(makePline spc lst rail1
)) (mkhatch spc obj lst hLayer)
(setq lst
(list(up p1 ang y1
)(up p2 ang y1
)(up p2 ang y2
)(up p1 ang y2
))) (setq obj
(makePline spc lst rail2
)) (mkhatch spc obj lst hLayer)
;; Draw pickets
pll
(polar pll
(+ ang
(/ pi
2)) ht
) ))
(setq obj
(makePline spc lst defLayer
)) (mkhatch spc obj lst hLayer)
) ; end repeat
)
)
)