X11start Posted November 10, 2021 Posted November 10, 2021 In my lisps, when I have to do a (command "Text"... I have always used a font with height 0. If I running my lisp, on drawings that have fonts with defined height ... my "commands" no longer work correctly. Is there a flag or a dxf code to understand if the font I should use has height 0 or defined height? Practically I would need a value that makes the lisp understand whether to use: (command "_text" "_mc" pos htxt rot "MY TEXT") or: (command "_text" "_mc" pos rot "MY TEXT") Quote
mhupp Posted November 10, 2021 Posted November 10, 2021 (edited) I am guessing you mean the style is set to 0 text height? 0 means you can have different sizes when you create a new mtext or text allowing the use to set 'textsize. if a text style as a set height it will change any text to that size when you set that style. (command "_text" "_mc" pos "" rot "MY TEXT") ;"" uses what ever the variable 'textsize is set to. (command "_text" "_mc" pos pause rot "MY TEXT") ;pause allows user to input a diffrent text size or enter/right click to accept default. --EDIT-- if htxt is set to real or string that option will also work. Edited November 10, 2021 by mhupp Quote
Tharwat Posted November 10, 2021 Posted November 10, 2021 Are you referring to text height in text style ? Quote
BIGAL Posted November 10, 2021 Posted November 10, 2021 Something like this (setq ts (cdr (assoc 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))) (if (zerop ts) (command "TEXT" "498,18" "3.5" "0" val1) (command "TEXT" "498,18" "0" val1) ) If use entmake can overwrite text height. (entmakex (list (cons 0 "TEXT") (cons 10 pt) (cons 40 hgt) (cons 1 str) (cons 50 ang) (cons 62 col) ) ) 2 Quote
X11start Posted November 11, 2021 Author Posted November 11, 2021 Many thanks for all the answers... and especially to Bigal: it was precisely the variable "TS", which I could not find! 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.