Jump to content

Recommended Posts

Posted

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

Posted

?

 

;; 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)
)

Posted

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.

Posted

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))

Posted

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?

Posted

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)
)

Posted

You can have a problem if 3D points are involved. Neither ( getpoint ) of ( distance ) have a built in 2D filters. -David

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...