Hi,
I would like to change the size and position of the label on this lisp.
Someone can help me, please?
Many Thanks
Size: 150
Postition: top-center from the point
(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)
)
Solved! Go to Solution.
Solved by ВeekeeCZ. Go to Solution.
thanks for this.
I add top-center + text height + conversion in meter.
I have a problem with moving up by 210mm
the label. Should be the insertion point (code 20?) but doesn't work.
(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")
'(40 . 140)
'(71 . 2)
(cons 1 (strcat (rtos (/ (cadddr p) 1000.))))
p
)
)
)
)
(princ)
)
This is what I get. In red what it should do.
Thanks. I found this Lisp in a forum, and it works very well but needed customization. My knowledge of the LISP language is limited, so I'm not sure how to implement a POLAR move.
Regard Mtext... It was Mtext on the original lisp. I don't know the reason for that.
Regard Top-Middle... because the final result should be similar to this:
Your screenshot is perfect. I need help implementing it in Lisp. My attempt to implement the Polar Move function in Lisp failed. The syntax is incorrect.
(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")
'(40 . 140)
'(71 . 2)
(cons 1 (strcat (rtos (/ (cadddr p) 1000.))))
(command "._move" s "" "0,0,0" "@150<90")
p
)
)
)
)
(princ)
)
The move is a bad idea.
Version for your mtext which dose not make much sense to me and my text version.
(defun c:zpt-mtext ( / 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") '(40 . 140) '(71 . 2) (cons 1 (strcat (rtos (/ (cadddr p) 1000.) 2 2))) (cons 10 (polar (cdr p) (/ pi 2) 210.)) ) ) ) ) (princ) ) (defun c:zpt-text ( / i p s ) (if (setq s (ssget '((0 . "POINT")))) (repeat (setq i (sslength s)) (setq p (cdr (assoc 10 (entget (ssname s (setq i (1- i))))))) (entmake (list (cons 0 "TEXT") (cons 10 p) (cons 11 p) (cons 40 140) '(72 . 1) '(73 . 1) (cons 1 (strcat (rtos (/ (caddr p) 1000.) 2 2))))))) (princ) )
Can't find what you're looking for? Ask the community or share your knowledge.