Jump to content
Lippens Infra

text to point height

Recommended Posts

Lippens Infra

hello,

 

I have a file where there are a lot of points measured in height. The height is displayed as text. Is it possible to generate a point on the insertion point of the text (x and y) and the Z value is the value of the text?

 

Thanks

Landmetersplan.dxf

Share this post


Link to post
Share on other sites
Tharwat

Hi,

Something like this?

(defun c:Test (/ int sel ent get ins)
  ;; Tharwat - 18.Nov.2020	;;
  (and (princ "\nSelect Texts : ")
       (setq int -1
             sel (ssget "_:L" '((0 . "TEXT")))
       )
       (while (setq int (1+ int)
                    ent (ssname sel int)
              )
         (and (setq get (entget ent)
                    ins (cdr (assoc (if (and (zerop (cdr (assoc 72 get)))
                                             (zerop (cdr (assoc 73 get)))
                                        )
                                      10
                                      11
                                    )
                                    get
                             )
                        )
              )
              (entmake (list '(0 . "POINT")
                             (cons 10 (mapcar '+ '(0. 0.) ins))
                             (assoc 8 get)
                       )
              )
              (entmod
                (subst (cons 1 (rtos (caddr ins) 2 4)) (assoc 1 get) get)
              )
         )
       )
  )
  (princ)
)

 

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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