Qonfire Posted February 6, 2012 Posted February 6, 2012 Hello ppl I want to be able to store the pointer coordinates upon pressing left mouse button, while getdist is active. I did something here: (setq lcoo nil) (while (getdist) ;if i take of this line it works similar to what I want ,but the prupose is to store points while getdistance active and left button is pressed. ( getdist have 2 points so at least i want to store 2 points) With this line (while (getdist) i get every second point???and not very sure about it. (setq value (grread)) (if (= (car value) 3) (setq ptc (cadr value)) ) (setq lcoo (append lcoo (list ptc))) ) thanks Quote
Lee Mac Posted February 6, 2012 Posted February 6, 2012 ? ;; Get Points - Lee Mac ;; Returns a list of UCS points selected by the user (defun LM:GetPoints ( / l p ) (if (car (setq l (list (getpoint "\nFirst Point: ")))) (while (setq p (getpoint "\nNext Point <Done>: " (car l))) (mapcar '(lambda ( a b ) (grdraw a b 3 1)) (setq l (cons p l)) (cdr l) ) ) ) (redraw) (reverse l) ) Quote
Qonfire Posted February 6, 2012 Author Posted February 6, 2012 Thanks for reply Lee I wonder if this is possible during getdist. Getdist required two points i want to save them while getdist is active. Quote
Lee Mac Posted February 6, 2012 Posted February 6, 2012 The above code is doing essentially the same thing. To get the distance between successive points from the returned list: (setq lst (LM:GetPoints)) (mapcar 'distance lst (cdr lst)) Quote
Qonfire Posted February 6, 2012 Author Posted February 6, 2012 I'm gonna give it last shot...different way... Can I find out the points coordinates that were picked when getdist was active...(2points).I mean i want a distance and points coordinates. briefly how to see points of getdist? Quote
Lee Mac Posted February 6, 2012 Posted February 6, 2012 I thought you would've put 2 and 2 togther, just use getpoint then distance. (if (and (setq p1 (getpoint "\nSpecify First Point: ")) (setq p2 (getpoint "\nSpecify Second Point: " p1)) ) (distance p1 p2) ) Quote
David Bethel Posted February 6, 2012 Posted February 6, 2012 You can have a problem if 3D points are involved. Neither ( getpoint ) of ( distance ) have a built in 2D filters. -David 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.