Jump to content

Recommended Posts

Posted

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

 

Posted

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

 

  • Thanks 1
Posted
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.

 

image.png.aae29f8ec6d016a8d80b9a1a09320458.png

Posted (edited)

Why not use a temp rectangle then delete it? Might help if you posted the actual code you're using too.

Edited by ronjonp

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