
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear all,
I got a lisp code that can generate required no of rows and columns inside a two corners of a rectangle. But I need a change in that it should ask for selection for rectangle irrespective of the rectangle is in straight or in inclination position
(defun C:LRR (/ c1 c2 wid ht rows cols blk); = Lights in Rectangular [& orthogonal] Room
(setq
c1 (getpoint "\nCorner of room: ")
c2 (getpoint "\nOpposite corner: ")
wid (abs (- (car c1) (car c2)))
ht (abs (- (cadr c1) (cadr c2)))
rows (getint "\nNumber of rows (---): ")
cols (getint "\nNumber of columns (|||): ")
blk (cdr (assoc 2 (entget (car (entsel "\n Select Block")))))
); setq
(command
"_.minsert" blk
(mapcar '+ ; insertion point
(list (min (car c1) (car c2)) (min (cadr c1) (cadr c2))); lower left of room
(list (/ wid cols 2) (/ ht rows 2)); fractions of width/height
); mapcar
"" "" "" ; X, Y, rotation defaults -- edit if needed
rows cols (/ ht rows) (/ wid cols); numbers and spacings
); command
(princ)); defun
Solved! Go to Solution.