tive29 Posted April 18, 2017 Posted April 18, 2017 Quite often I draw lines from many entities at different location to a central origin point. Instead of drawing them 1 bat a time, Is there a lisp that I can click those entities with the last click for the central origin point like the picture below Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 Hi, What are the names of these entities? Points, Blocks, Circles .... etc. So can you list them down here? Quote
guran Posted April 18, 2017 Posted April 18, 2017 Draw the first line, select line and then the grip point att the end, right click and select copy. Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 Hi, What are the names of these entities? Points, Blocks, Circles .... etc. So can you list them down here? Tharwat, to be clearer, its not so much the type of entities, rather it is more like a kind of marker or marking for me or my workers to refer to multiple location in the drawing. So as an example of how the lisp were to run is (base on the photo in the 1st post) 1)I will be clicking on multiple location in the drawing (1st click, 2nd click, 3rd click & 4th click) 2)for the last click I will click a distance away from all the previous clicks then press ENTER 3)lisp will then draw all the line from all the clicks (1st click to 4th click) to the last click (which will be the central location) Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 Draw the first line, select line and then the grip point att the end, right click and select copy. There is no copy option at the grip point. Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 Something like this? (defun c:Test (/ int inp pt1 lst pt2) ;; Tharwat - Date: 18.4.2017 ;; (setq int 0 inp '("1st" "2nd" "3rd" "4th" "Base") ) (while (and (< int 5) (setq pt1 (getpoint (strcat "\nSpecify " (nth int inp) " Point :"))) ) (setq int (1+ int) lst (cons pt1 lst) ) ) (and (= (length lst) 5) (foreach p (cdr lst) (entmake (list '(0 . "LINE") (cons 10 (car lst)) (cons 11 p))) ) ) (princ) ) Quote
rkent Posted April 18, 2017 Posted April 18, 2017 There is no copy option at the grip point. Read the post carefully, select the line and then the grip point at the end, RIGHT CLICK and select copy. Instead of the right click you can type C for copy at that point as seen in the command line options after the grip is selected. Quote
marko_ribar Posted April 18, 2017 Posted April 18, 2017 Tharwat, I think you understood it literally... I think that OP means input as much points as needed - while loop is needed and when it's terminated, user should pick base point and then routine should connect all points from stored list of points obtained while looping with base one... Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 Tharwat, I think you understood it literally... I think that OP means input as much points as needed - while loop is needed and when it's terminated, user should pick base point and then routine should connect all points from stored list of points obtained while looping with base one... That's exactly what I thought when I was readying the 1st post but it seems that they insist on four points than looping with a base point at the conclusion. Have a read about post# 4 Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 That's exactly what I thought when I was readying the 1st post but it seems that they insist on four points than looping with a base point at the conclusion. Have a read about post# 4 Tharwat, apologies, I meant the 4 clicks as an example. it will be many clicks as marko has mention with the last click as the origin after pressing ENTER. Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 Tharwat, apologies, I meant the 4 clicks as an example. it will be many clicks as marko has mention with the last click as the origin after pressing ENTER. No worries at all. (defun c:Test (/ pnt lst bas) ;; Tharwat - Date: 18.4.2017 ;; (while (setq pnt (getpoint "\nSpecify Point :")) (setq lst (cons pnt lst)) ) (and lst (setq bas (getpoint "\nSpecify base Point :")) (foreach p lst (entmake (list '(0 . "LINE") (cons 10 bas) (cons 11 p))) ) ) (princ) ) Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 Tharwat, thats it. Thanks If it is not too much trouble, can there be some kind of point (that will disappear after the lines are drawn) to indicate where I have click before during the lisp routine. That would be helpful as the location of the clicks are plenty & all over the drawing & I may forget that i have click that location before. Thanks Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 Why don't you go with a method to select as much points as you want then specify a base point and finally delete all the selected points and draw the lines of course? Is this okay with you? Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 Why don't you go with a method to select as much points as you want then specify a base point and finally delete all the selected points and draw the lines of course? Is this okay with you? mmmm... not quite understand what you mean. Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 mmmm... not quite understand what you mean. Like the following video: Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 yea Tharwat. I could work with that. Although I still prefer your last lisp except just missing the visual cues. Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 yea Tharwat. I could work with that. Although I still prefer you last lisp except just missing the visual cues. (defun c:Test (/ sel obj lst pts bas) ;; Tharwat - Date: 18.4.2017 ;; (princ "\nSelect point objects :") (if (setq sel (ssget "_:L" '((0 . "POINT")))) (while (setq obj (ssname sel 0)) (setq lst (cons (cdr (assoc 10 (entget obj))) lst) pts (cons obj pts)) (ssdel obj sel) ) ) (and lst (setq bas (getpoint "\nSpecify base Point :")) (foreach p lst (entmake (list '(0 . "LINE") (cons 10 bas) (cons 11 p))) ) (mapcar 'entdel pts) ) (princ) ) Quote
tive29 Posted April 18, 2017 Author Posted April 18, 2017 Thanks Tharwat. Will use the 2nd lisp for those complicated ones. Quote
Tharwat Posted April 18, 2017 Posted April 18, 2017 Thanks Tharwat. Will use the 2nd lisp for those complicated ones. You have many options now. Good luck. Quote
marko_ribar Posted April 18, 2017 Posted April 18, 2017 tive29, study the variable BLIPMODE... Second Tharwat's code is just fine, just implement BLIPMODE inside code (use getvar to store default value at the beginning, set it to 1, and at the end restore stored value from beginning)... 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.