CADWORKER Posted January 4, 2021 Share Posted January 4, 2021 On 6/20/2016 at 3:12 PM, Maximum GSP said: Very nice, but i have one other question too : I wish to place a specified block (with Z automatic attribute) on every selected blocks in my drawing, how can i do that ? I try to change your code, but... And i have to do that with a separated block (with specified name), not with the attributes of all my blocks, so i can change all "texts" in one step Hi, Is there any way of getting the text values in the same layer of the point. Thanks Quote Link to comment Share on other sites More sharing options...
CADWORKER Posted January 5, 2021 Share Posted January 5, 2021 On 10/18/2012 at 2:22 PM, Lee Mac said: Thanks pBe If I were to rewrite the function today, I'd probably use something like: (defun c:zpt ( / i p s ) (if (setq s (ssget '((0 . "POINT")))) (repeat (setq i (sslength s)) (setq p (assoc 10 (entget (ssname s (setq i (1- i)))))) (entmake (list '(000 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (cons 1 (strcat "Z = " (rtos (cadddr p)))) p ) ) ) ) (princ) ) How to get the text on same layer of the point, I tried (assoc 8 its not working) Quote Link to comment Share on other sites More sharing options...
ronjonp Posted January 5, 2021 Share Posted January 5, 2021 Try this: (defun c:zpt (/ el i p s) (if (setq s (ssget '((0 . "POINT")))) (repeat (setq i (sslength s)) (setq p (assoc 10 (setq el (entget (ssname s (setq i (1- i))))))) (entmake (list '(000 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (assoc 8 el) (cons 1 (strcat "Z = " (rtos (cadddr p)))) p ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
CADWORKER Posted January 5, 2021 Share Posted January 5, 2021 1 hour ago, ronjonp said: Try this: (defun c:zpt (/ el i p s) (if (setq s (ssget '((0 . "POINT")))) (repeat (setq i (sslength s)) (setq p (assoc 10 (setq el (entget (ssname s (setq i (1- i))))))) (entmake (list '(000 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") (assoc 8 el) (cons 1 (strcat "Z = " (rtos (cadddr p)))) p ) ) ) ) (princ) ) Its perfect; Thanks for the help.. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted January 5, 2021 Share Posted January 5, 2021 You're welcome. Quote Link to comment Share on other sites More sharing options...
paulhea Posted September 24, 2021 Share Posted September 24, 2021 Can anybody help me alter this lisp so it only displays 2 decimal places instead of 3 please Quote Link to comment Share on other sites More sharing options...
zwonko Posted September 24, 2021 Share Posted September 24, 2021 Just look for the help to rtos function. (rtos (cadddr p) 2 2) will give decimal with two places Quote Link to comment Share on other sites More sharing options...
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.