mikarts Posted June 7 Posted June 7 Hi again. Thank you as always for your help, and also sorry for my awful English. I have a routine that draws an arrow between two points. The routine asks for the two points needed, and it works fine. Of course we can add undo, osmode and other improvements, but now I wonder if it is anyway for drawing a temporary vector from the first point to the cursor, like "line" or "dist" commands do. I know grdraw but, I think that grdraw is not usable in this case. Here is the code: ;; Flecha. Esta orden dibuja una flecha solicitando el punto inicial y final de la línea base (DEFUN c:flecha (/ pt1 pt2 pt3 pt4 ang1 ang2) (initget 32) (setq pt1 (getpoint "\n Marque el punto inicial de la flecha: ")) (setq pt2 (getpoint "\n Marque el punto del vértice: ")) (setq osmodepre (getvar "osmode")) (setvar "osmode" 0) (setq ang (angle pt2 pt1)) (setq ang1 (+ ang (/ PI 6))) (setq ang2 (- ang (/ PI 6))) (setq pt3 (polar pt2 ang1 0.15)) (setq pt4 (polar pt2 ang2 0.15)) (command "_line" pt1 pt2 "") (command "_pline" pt3 pt2 pt4 "") (setvar "osmode" osmodepre) ) Quote
Tharwat Posted June 7 Posted June 7 (setq pt2 (getpoint "\n Marque el punto del vértice: " pt1)) Quote
GLAVCVS Posted June 7 Posted June 7 (setq pt2 (getpoint pt1 "\n Marque el punto del vértice: ")) Quote
mikarts Posted June 7 Author Posted June 7 @Tharwat @Glavcvs Thank you very much. It works perfect! 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.