nemo Posted August 14, 2008 Share Posted August 14, 2008 I've tried to write a LISP routine quickly, but came up with nothing -- just lots of errors and gibberish. I have never written a true script before, so would consider myself an extreme beginner when it comes to LISP. I just don't have the time to spend and figure it out as work is very busy. Basically, what I need to do is take a windowed area, and create a 3x3 grid in that window. I need the spacing to be even... ie: x spacing = x length/3, y spacing = y length/3. (The windowed area may be a rectangle, not always a square) Ideally, I would like a small circle placed within each square. Would the easiest way be to create one square with a circle, and then array it? I am so helpless right, lol. Think anyone can help me out? I attached an example Quote Link to comment Share on other sites More sharing options...
fixo Posted August 14, 2008 Share Posted August 14, 2008 See how it will work for you (defun C:rac (/ cpt hgt leng pt1 pt2 pt3 rad ss) (setq leng (getdist "\nEnter the length of an outer contour: ") hgt (getdist "\nEnter the height of an outer contour: ") rad (/ leng 60.) ;<-- change the radius to your suit ) (setq pt1 (getpoint "\nPick the lower left corner: ") pt1 (list (car pt1) (cadr pt1)) pt2 (list (+ (car pt1) leng) (+ (cadr pt1) hgt)) ) (command "._rectang" "_non" pt1 "_non" pt2) (setq pt3 (list (+ (car pt1) (/ leng 3)) (+ (cadr pt1) (/ hgt 3)))) (setq ss (ssadd)) (command "._rectang" "_non" pt1 "_non" pt3) (ssadd (entlast) ss) (setq cpt (mapcar (function (lambda (a b) (/ (+ a b) 2))) pt1 pt3)) (command "._circle" "_non" cpt rad) (ssadd (entlast) ss) (command "._-array" ss "" "_R" 3 3 (/ hgt 3) (/ leng 3)) (princ) ) (princ "\nStart command with RAC...") (princ) ~'J'~ Quote Link to comment Share on other sites More sharing options...
nemo Posted August 15, 2008 Author Share Posted August 15, 2008 omg, you're the best. I can't believe you did that so quickly! That would have taken me a couple of days! Quote Link to comment Share on other sites More sharing options...
fixo Posted August 15, 2008 Share Posted August 15, 2008 Always glad to help Cheers ~'J'~ Quote Link to comment Share on other sites More sharing options...
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.