Jump to content

Small help with this routine .


Michaels

Recommended Posts

Hello ,

 

How is the proper way of using grdraw within this routine ?

 

(if (and (setq p1 (getpoint "\n Specify point:"))
          [color="red"](grdraw p1 (setq p2 (getpoint "\n Specify point:")) 1 1)[/color]
    )
     (entmakex (list (cons 0 "LINE")
	      (cons 10 p1)
	      (cons 11 p2)
	      )
	)
   (princ)
   )

 

Many Thanks.

 

Michaels

Link to comment
Share on other sites

No need for grdraw:

 

(if (and (setq p1 (getpoint "\n Specify point:"))
        (setq p2 (getpoint "\n Specify point:" p1))
   )
 (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))
 (princ)
)

 

Look up the getpoint function in the VLIDE help files.

Link to comment
Share on other sites

Thanks Lee.

 

I 've done that way first, but I just wanted to have something enjoyable with the routine with the use of (grdraw) function .

 

Isn't it possible to have it with the routine ?

 

Appreciated.

Link to comment
Share on other sites

Michaels,

Lee Mac is right. You don't need grdraw if all you want is to draw a line with entmake between p1 and p2. I am not sure what you want to do with grdraw, but I wish to point out that the 'and' function in your code will always return nil because the grdraw returns nil, so the entmake will never execute.

Link to comment
Share on other sites

(defun c:WasteOfTime ( / p q g )
 (if
   (and
     (setq p (getpoint "\nPick First Point: "))
     (progn  (princ "\nNow try to pick another without OSnap, Tracking, or any keyboard input...")
       (while (= 5 (car (setq g (grread 't 13 0)))) (redraw)
         (grdraw p (cadr g) 3 1)
       )
       (listp (setq q (cadr g)))
     )
   )
   (entmakex (list (cons 0 "LINE") (cons 10 p) (cons 11 q)))
 )
 (redraw) (princ)
)

Link to comment
Share on other sites

Well you can use grread, but then you will lose OSnap, tracking, and just about everthing else - so IMO there is no point.

 

No problem it's OK with me,

 

grread would bring me to the other seashore which I prefer to keep on in the same line. :lol:

 

Thanks a lot Lee.

 

* Also Mr. CALCAD, you're right the routine hasn't completed due to the uncompletition of the function grdraw or otherwise the nil return of it .

 

Many thanks for you all.

 

Michaels

Link to comment
Share on other sites

(defun c:WasteOfTime ( / p q g )
 (if
   (and
     (setq p (getpoint "\nPick First Point: "))
     (progn  (princ "\nNow try to pick another without OSnap, Tracking, or any keyboard input...")
       (while (= 5 (car (setq g (grread 't 13 0)))) (redraw)
         (grdraw p (cadr g) 3 1)
       )
       (listp (setq q (cadr g)))
     )
   )
   (entmakex (list (cons 0 "LINE") (cons 10 p) (cons 11 q)))
 )
 (redraw) (princ)
)

 

A very nice name of routine :)

It does deserve it.

 

Actually it is useless without tracking besides osnap grids on.

 

Thank you for your hard work, and your precious time as well Lee.

 

many thanks my friend.

 

Michaels

Link to comment
Share on other sites

Thanks Lee.

 

I 've done that way first, but I just wanted to have something enjoyable with the routine with the use of (grdraw) function .

 

Isn't it possible to have it with the routine ?

 

Appreciated.

it.blows my mind how much time people waste on flash.
Link to comment
Share on other sites

it.blows my mind how much time people waste on flash.

 

Me too, not that interested in flashs, but that was the first time I have thought of things like that. :)

 

Thanks Alanjt

Link to comment
Share on other sites

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