autolisp points in a column

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Here's the elvator pitch. I'm working on a LISP that will select a rectangular area, define points inside that area, open a dialog box that lets you add multiple blocks to a list, and then chronologically places the blocks on the points in the area. I think this will be useful for typical details. This is definitely a project I'm going to work on and off for a while as my reach is currently exceeding my grasp.
Currently I'm writing a function that will generate a list of points (p1, p2, p3, etc, quid pro quo...) until a certain point is reached. I've tried using the repeat function but doesn't seem to adjust the numbering (p1 to p2 to p3). Any advice?
;;---FCN FOR POINTS---;;
REPEAT THIS ROW UNTIL IT MATCH THE NUMBER OF COLUMNS
(defun c:4 ()
(getpoint crn1 "n\First corner of rectangular area:")
crn2 (getcorner "n\Second corner of rectangular area:")
(getreal
c "\nEnter number of Columns:" ;SET DEFAULT 4
r "\nEnter number of Rows:" ;SET DEAULT 3
) ;end getreal
(princ)
) ;end function 4
;;---START---;;
(defun grdcol (crn1 crn2 c r /) ;functions sets up the point for the point grid column (grdcol). When inserting the blookcs the main function grabs from here.
(setq
r1 (+ r 1) ; makes it easier to divide amongst the rows. Maybe. Revisit.
r2 (* r1 2) ; distance between to points in column in y direction. Revisit
p1 (list (- (car crn2) (/ (car crn2) r1)) (- (cadr crn2) (/ (cadr crn2) r1))) ;everything in this column will have the same 'x'. 'y' changes.
;WANT TO DO THIS UNTIL y= (+ (cadr crn1) (/ (cadr crn2) r1))