rog1n Posted March 8, 2021 Posted March 8, 2021 Hello, I have a fuction that create a list of points to grvecs draw alot of retangle on the screen (like the simple example above): (defun points nil (list 3 (list 00 00) (list 00 10) 3 (list 00 10) (list 10 10) 3 (list 10 10) (list 10 00) 3 (list 10 00) (list 00 00) ) ) Now I need to get two points, but if a move the screen ou zoom in/out the draw dissaper . I belive I need to use grread and redraw everytime, but I dont know how do this with getpoint and getcorner. (defun c:test() (grvecs (points)) ;(while.... ;(grvecs (points)) (setq p1 (getpoint "P1: ") p2 (getcorner p1 "P2: ")) ;) ) Quote
Tharwat Posted March 8, 2021 Posted March 8, 2021 Something like this ? (defun c:Test (/ p l a) (while (setq p (getpoint "\nSpecify point :")) (setq l (cons p l) a (car l) ) (foreach q (cdr l) (grdraw a q 3 -1) (setq a q) ) ) (redraw) (princ) ) 1 Quote
rog1n Posted March 8, 2021 Author Posted March 8, 2021 29 minutes ago, Tharwat said: Something like this ? (defun c:Test (/ p l a) (while (setq p (getpoint "\nSpecify point :")) (setq l (cons p l) a (car l) ) (foreach q (cdr l) (grdraw a q 3 -1) (setq a q) ) ) (redraw) (princ) ) Thank you for reply, but No, I need the (grvecs (points)) always display the square (the square is just a example, the real fuction draw many squares) while I will get the p1 and p2, but If I pan/ or zoom in/out the square disappear. Quote
ronjonp Posted March 9, 2021 Posted March 9, 2021 (edited) Why not use a temp rectangle then delete it? Might help if you posted the actual code you're using too. Edited March 9, 2021 by ronjonp 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.