Clifford169 Posted October 4, 2017 Posted October 4, 2017 I've been of the drawing circuit for a while now because I've been undertaking rack safety inspections. I came back to drawing some elevations the other day and decided there must be an easier way to draw these damn window mullions. Now, I've had a look around my usual sources and can't find anything that's doing what I'd like. I did look at this for example, but it's not quite what I need, especially given that we work to a different scale: http://www.cadtutor.net/forum/showthread.php?11921-Easy-lisp-brain-fart&highlight=window+mullions Basically, I need to be able to select a window opening, choose an offset distance for the frame and then select how many boxes are to fit in there (rows & columns) and the distance between them. Each box (pane of glass) would then be offset 10mm for emphasis. I profess to not be very competent at lisp routines, but from my brief experience I don't expect this to be too complex? If anyone has something that I can work with or can create something for me that'd be much appreciated! Quote
BKT Posted October 5, 2017 Posted October 5, 2017 When you say the "distance between them" is that the spacing between panes or from pane to pane? Is this width different between rows and columns if it's between panes? Quote
BIGAL Posted October 5, 2017 Posted October 5, 2017 It can be done by just thinking about some simple constraints. Start with pick lower left, top then right this establishes your sizes Hor & Vert Number of panes Hor & Vert edge distance Equal size or more complex enter sizes last just fills in for approximate look Now the formula say Horizontal is 3 (Hordist-(3+1)*egde)/ 3 = size of horizontal pane Repeat for vertical panes Ok we take lower left point x = x+edge y=edge+Verpane using (car pt1) this is X value and (cadr pt1) this is y, we can now work out a new point Pt2 Using retang pt1 pt2 pane is drawn using a double repeat draw all panes. Will try to find time to do something. If you have the right software you can do like this. Quote
Clifford169 Posted October 9, 2017 Author Posted October 9, 2017 I appreciate the input guys! Typically the window type I'm considering this for is a typical Victorian townhouse with timber sash windows. I'd give more info but that'll have to wait as I'm swamped today and tomorrow. BKT, I'd like the option to choose the distance between rows/columns separately if possible, as they are occasionally different. And I mean distance between the panes. BIGAL, this looks like it's headed in the right direction. We only work in 2D though, unfortunately. Also we dont work with architectural indications like the arrow you have on the window... We basically create a line drawing elevation for 99% of our elevations usually from 'tracing' over 3D scanned ortho-photos. Again, your input is much appreciated! Quote
BKT Posted October 9, 2017 Posted October 9, 2017 I went ahead and put this together to see what it might take. No error checking, not pretty, but give it a try to see if it's a place to start. The emphasis offset of 10.0 is hardcoded. (defun c:test (/ frm xnum ynum xspace yspace xpane ypane pane pane2 ptc pt1 pt2 pt3 pt4 ptp1 ptp2 ptp3 ptp4) (setvar "CMDECHO" 0) (initget 7) (setq frm (getreal "\nEnter Frame Offset: ")) (initget 7) (setq xnum (getint "\nEnter Number for Columns of Panes: ")) (initget 7) (setq xspace (getreal "\nEnter Column Space Distance: ")) (initget 7) (setq ynum (getint "\nEnter Number for Rows of Panes: ")) (initget 7) (setq yspace (getreal "\nEnter Row Space Distance: ")) (setq pt1 (getpoint "\nSelect Lower Left Window Corner: ") pt3 (getpoint "\nSelect Upper Right Window Corner: ") pt2 (list (car pt3)(cadr pt1)) pt4 (list (car pt1)(cadr pt3)) ptc (mapcar '(lambda (q p) (/ (+ q p) 2.0)) pt1 pt3) xlen (- (distance pt1 pt2) (* 2 frm)) ylen (- (distance pt1 pt4) (* 2 frm)) xpane (/ (- xlen (* (1- xnum) xspace)) xnum) ypane (/ (- ylen (* (1- ynum) yspace)) ynum) ptp1 (list (+ (car pt1) frm)(+ (cadr pt1) frm)) ptp2 (list (+ (car ptp1) xpane)(cadr ptp1)) ptp3 (list (+ (car ptp1) xpane)(+ (cadr ptp1) ypane)) ptp4 (list (car ptp1)(+ (cadr ptp1) ypane)) ) (entmakex (append (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 90 4) (cons 70 1) (cons 10 ptp1) (cons 10 ptp2) (cons 10 ptp3) (cons 10 ptp4)))) (setq pane (entlast)) (setq ptc (mapcar '(lambda (q p) (/ (+ q p) 2.0)) ptp1 ptp2)) (command "_offset" "10.0" pane "_non" ptc "") ;; Hardcoded "10.0" offset for trim (setq pane2 (entlast)) (cond ((AND (= ynum 1)(= xnum 1)) T) ((= ynum 1) (command "-array" pane pane2 "" "R" ynum xnum (+ xpane xspace))) ((= xnum 1) (command "-array" pane pane2 "" "R" ynum xnum (+ ypane yspace))) ((OR (> ynum 1)(> xnum 1)) (command "-array" pane pane2 "" "R" ynum xnum (+ ypane yspace) (+ xpane xspace))) (t nil) ) (princ) ) Quote
Clifford169 Posted October 12, 2017 Author Posted October 12, 2017 BKT, that's very much what I was after. I'll have to use it a few times to see what I can/can't do with it but that's very much a good start! Thanks a lot for this. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.