leonucadomi Posted February 16 Posted February 16 hello: I wonder if there is a routine for this? I have a closed polyline like this 1.- I would like a routine that asks me for point pt1 and then point pt2 2.-after it asks me for the number of divisions (example 3.- and draw the following... any comment? thanks Quote
devitg Posted February 17 Posted February 17 13 hours ago, leonucadomi said: hello: I wonder if there is a routine for this? I have a closed polyline like this 1.- I would like a routine that asks me for point pt1 and then point pt2 2.-after it asks me for the number of divisions (example 3.- and draw the following... any comment? thanks @leonucadomiPlease upload your sample.dwg Quote
devitg Posted February 17 Posted February 17 (edited) @leonucadomi Find attached dwg and lisp leonucadoni - .dwg traza-lineas.LSP Edited February 17 by devitg update lsp Quote
BIGAL Posted February 17 Posted February 17 Hi devitg maybe use Xline for the temporary line working out the second point on the ellipse. It auto extends to infinity. 1 Quote
leonucadomi Posted February 19 Author Posted February 19 I found this and it is close to what I need but I would like to modify it so that it lets me select point 2 precisely so that the grid you draw does not go outside the polyline ; By RonJonP found @ http://www.theswamp.org/index.php?topic=25575.0 (defun c:detailgrid (/ cnt coldiv columnpts columns ll lr p pt rowdiv rowpts rows ul ur) (defun addplineforgrid (pt1 pt2 layer /) (vla-update (vlax-ename->vla-object (entmakex (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") (cons 8 layer) '(100 . "AcDbPolyline") '(90 . 2) '(43 . 0.0) (cons 10 pt1) (cons 10 pt2) ) ) ) ) ) (defun rjp-vector_x (pt clr / l bl br ul ur) (setq l (* 0.015 (getvar 'viewsize)) bl (polar pt 3.926 l) br (polar pt -0.785 l) ul (polar pt -3.926 l) ur (polar pt 0.785 l) ) (grvecs (list clr bl ur br ul)) (princ) ) (if (and (setq rows (getint "\nEnter number of rows: ")) (setq columns (getint "\nEnter number of columns: ")) (setq ul (getpoint "\nSelect upper left corner of grid: ")) (not (or (<= rows 0) (<= columns 0))) ) (progn (while (and (setq p (grread 5)) (= (car p) 5)) (redraw) (if (setq lr (osnap (cadr p) "_end,_int,_mid,_cen")) (rjp-vector_x lr 1) (setq lr (cadr p)) ) (setq ur (list (car lr) (cadr ul)) ll (list (car ul) (cadr lr)) rowdiv (/ (distance ul ll) rows) coldiv (/ (distance ul ur) columns) columnpts nil rowpts nil cnt 0 ) (repeat (1- rows) (setq cnt (+ cnt rowdiv) pt (polar ul (angle ul ll) cnt) ) (repeat columns (setq rowpts (cons (list pt (setq pt (polar pt (angle ul ur) coldiv))) rowpts ) ) ) (grvecs (cons 3 (apply 'append rowpts))) ) (setq cnt 0) (repeat (1- columns) (setq cnt (+ cnt coldiv) pt (polar ul (angle ul ur) cnt) ) (repeat rows (setq columnpts (cons (list pt (setq pt (polar pt (angle ul ll) rowdiv))) columnpts ) ) ) (grvecs (cons 5 (apply 'append columnpts))) ) (grtext -2 (strcat "Row: " (rtos rowdiv) " X Column: " (rtos coldiv)) ) ) ) ) (redraw) (foreach x rowpts (addplineforgrid (car x) (cadr x) "gridline") ) (foreach x columnpts (addplineforgrid (car x) (cadr x) "gridline") ) (princ) ) help please Quote
devitg Posted February 19 Posted February 19 @leonucadomi As i ask for before, please UPLOAD your sample dwg with BEFORE and AFTER. Btw Did you try my lisp? 1 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.