Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
Hope you are all doing great!
I'm still a beginner in autoLISP and would like to ask for your help on how to add the following in the code below:
- Specify the insertion point of the text extracted from a block attribute value which is aligned to the attribute (meaning if the attribute is rotated at 0 degree, the text that will be extracted will be at 0 deg too).
- Set the text style, text justification, text color, text height and text layer to my preference.
- A command that is incorporated in the program which changes the text height specified in number 2 and the last text height will remain as is unless it will be changed again.
Thank you very much in advance.
Regards,
Desmund
Below is the code:
(defun c:test (/ a b)
(vl-load-com)
(if (setq a (ssget '((0 . "INSERT") (66 . 1))))
(progn
(repeat (setq i (sslength a))
(setq b (vlax-ename->vla-object (ssname a (setq i (1- i)))))
(foreach x (vlax-invoke b 'getattributes)
(entmake
(list
(cons 0 "TEXT")
(cons 1 (strcat (vla-get-textstring x) ) )
(cons 10 (vlax-get x 'textalignmentpoint))
(cons 40 (vla-get-height x))
(cons 50 (vla-get-rotation x))
)
)
)
)
)
)
(princ)
)
Solved! Go to Solution.