Jump to content

Understand if the font has defined height or 0


X11start

Recommended Posts

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")

Link to comment
Share on other sites

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 by mhupp
Link to comment
Share on other sites

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)
	 )
      )

 

  • Like 2
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...