Jump to content

How to Caculator Distance between Text A and Text B?


Recommended Posts

Posted

try @Mountain_XD

(defun c:TextDist ( / ent1 ent2 pt1 pt2 dist)
  (setq ent1 (car (entsel "\nSelect first text: ")))
  (setq ent2 (car (entsel "\nSelect second text: ")))
  (if (and ent1 ent2)
    (progn
      (setq pt1 (cdr (assoc 10 (entget ent1))))
      (setq pt2 (cdr (assoc 10 (entget ent2))))
      (setq dist (distance pt1 pt2))
      (princ (strcat "\nDistance between texts: " (rtos dist 2 4)))
    )
    (princ "\nSelection failed.")
  )
  (princ)
)

 

Posted

Thank you so much hosneyalaa !

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