Jump to content

Recommended Posts

Posted

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

 

Posted
  (setq pt2 (getpoint "\n Marque el punto del vértice: " pt1))

 

Posted
(setq pt2 (getpoint pt1 "\n Marque el punto del vértice: "))

 

Posted

@Tharwat @Glavcvs Thank you very much. It works perfect!

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