Jump to content
Margusrebase

Autolisp to annotate 3d point z value

Recommended Posts

Margusrebase

Hei,

 

Can enyone make autolisp to annotate 3d point z value!

 

Best,

MRe

Share this post


Link to post
Share on other sites
Emmanuel Delay
Posted (edited)

Please be a bit more specific.

 

----

EDIT: do you mean something like this?

 

;; Lee Mac, @see http://www.cadtutor.net/forum/showthread.php?44768-Entmake-Functions
(defun Text (pt hgt str)
 (entmakex (list (cons 0 "TEXT")
                 (cons 10  pt)
                 (cons 40 hgt)
                 (cons 1  str))))

;; A Z for annotate z-value
(defun c:az ( / pt1)
 (setq pt1 (osnap (getpoint "\nSelect an endpoint: ") "_end,_int"))
 (Text pt1 2.5  (rtos (nth 2 pt1) 2  )
 (princ)
)

Edited by Emmanuel Delay

Share this post


Link to post
Share on other sites
Margusrebase

Hey,

 

I need a autolisp like following: i have 3d points in my drawing and i need autolisp that puting z value text beside 3d points!

 

Br,

Margus

Share this post


Link to post
Share on other sites
Emmanuel Delay

Oh yes, Points.

Select all okay?

COMMAND: AZP (for Annotate Z Points)

 

;; Lee Mac, @see http://www.cadtutor.net/forum/showthread.php?44768-Entmake-Functions
(defun Text (pt hgt str)
 (entmakex (list (cons 0 "TEXT")
                 (cons 10  pt)
                 (cons 40 hgt)
                 (cons 1  str))))

(defun c:azp ( / pt1 i ss)
 (setq ss (ssget "_X" '((0 . "POINT"))))
 (setq i 0)
 (repeat (sslength ss)
   (setq pt1 (cdr (assoc 10 (entget (ssname ss i))))  )
   (Text pt1 2.5  (rtos (nth 2 pt1) 2  ) 
   (setq i (+ i 1))
 )
 (princ)
)  

Share this post


Link to post
Share on other sites
Margusrebase

I need only 3 decimal places!

 

Thanks!

Share this post


Link to post
Share on other sites
Emmanuel Delay

(Text pt1 2.5  (rtos (nth 2 pt1) 2  ) 

Change the 8 into a 3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×