Grread grdraw

Grread grdraw

Anonymous
Not applicable
2,039 Views
4 Replies
Message 1 of 5

Grread grdraw

Anonymous
Not applicable

(defun c:gline ()

(setq ep1 (getpoint " First Point Elbow Direction From mid: "))

(while (= (car (setq grr (grread t 0))) 5)
(redraw)

(setq ep2 (cadr grr))

(grdraw ep1 ep2 1 0)
)
(command "line" ep1 ep2 "")
(princ)

)

 

 

 

how get Osnap when we pick the second point????

2,040 Views
4 Replies
Replies (4)
Message 2 of 5

marko_ribar
Advisor
Advisor

If you need to draw line, why do you need grread?

For osnaps while using grread, study Lee Mac's GrSnap function posted on his web site...

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 3 of 5

dbroad
Mentor
Mentor

If your intent is to get points simulating the behavior of the line command, you may not be aware that getpoint takes also takes a point argument.

 

(setq ep2 (getpoint  ep1 "Next Point Elbow Direction From mid: "))

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 4 of 5

DannyNL
Advisor
Advisor

Why would you want to have a routine at all for this, while it just draws a line between 2 points?

LINE command does exactly that and you can keep drawing for as long as you want. Only difference is that you don't have the same prompt.

 

Is there something special that you want the command to do?

If not, it's more wise to stick to the standard AutoCAD commands if they can give the same result. 

0 Likes
Message 5 of 5

Anonymous
Not applicable

Saved my life!!! Tnk u!!!

I'm just a beginner, and this example show me wich way to go!!

Because of this example i could understand the function grdraw using grread, and therefore discover how the grvecs function works!

0 Likes