NIEKO Posted August 12, 2019 Posted August 12, 2019 EXAMPLE 01 - 5mm HIGH TEXT "100mm THICK MILD STEEL FLAT BAR" ########################### above is a string of text on a drawing ------ question is as follows____how can I extract or obtain (with a lisp function) only the "textsize"/"textheight" value from the string to use the value in a lisp routine appreciated NIEKO Quote
SLW210 Posted August 12, 2019 Posted August 12, 2019 I have moved your thread to the AutoLISP, Visual LISP & DCL Forum. Please post in the appropriate forum. Quote
Emmanuel Delay Posted August 12, 2019 Posted August 12, 2019 Open a notepad document, copy/paste this code, save as print_text_height.lsp (feel free to rename, but keep the .lsp, and make sure ther's no .txt at the end of that). Drag the .lsp file in your Autocad active document Type command GTH, press enter (defun c:gth ( / th) (setq th (cdr (assoc 40 (entget (car (entsel "\nSelect TEXT object: ")))))) (princ "\nText height: ") (princ th) (princ) ) Quote
NIEKO Posted August 12, 2019 Author Posted August 12, 2019 Emmanuel Thanks a lot. I really appretiate it NIEKO 1 Quote
BIGAL Posted August 13, 2019 Posted August 13, 2019 Another same thing using v lisp (setq obj (vlax-ename->vla-object (car (entsel "pick text object")))) (setq ht (vla-get-height obj)) (alert (strcat "height is " (rtos ht 2 1))) Quote
NIEKO Posted August 14, 2019 Author Posted August 14, 2019 BIGAL Thanks a lot for your help and input I appreciate it very much I would like to compliment all you guys for an excellent CAD forum NIEKO Quote
ronjonp Posted August 14, 2019 Posted August 14, 2019 If you want the actual height of the text in the drawing use the TEXTBOX function. A string with the same height like "1234" will not be the same physical height as "{1234,". Try it (if (setq e (car (entsel "\nPick text: "))) (print (abs (apply '- (mapcar 'cadr (textbox (entget e)))))) ) 2 Quote
BIGAL Posted August 17, 2019 Posted August 17, 2019 Good one ronjonp, don't forget droppers, superscript, subscript. Jj Ggx² Quote
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.