Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

is it possible to change the font style of 1 text item?

7 REPLIES 7
Reply
Message 1 of 8
andrew.nao
1159 Views, 7 Replies

is it possible to change the font style of 1 text item?

im my current coding project im attempting to change the font stlye of 1 text item

i tried used the simple method of

[code]

(command "STYLE" "simplex" "ARIAL" "" "" "" "" "")

[/code]

 

however, using this changes the text's font in the whole drawing

i searched the forums here and everything i found either didnt work or changed all the text.

 

is there a more elegant way of doing this with just a selected text item and not the text in the whole drawing?

 

7 REPLIES 7
Message 2 of 8
SomeBuddy
in reply to: andrew.nao

What you are doing there is to change a font on a style, so all the text on that style will change the appearance. You need to change the style on a specific text entity:

 

(vla-put-stylename

  (vlax-ename->vla-object  (car  (entsel)))
  "newstyle"
)

 

HTH

Message 3 of 8
scot-65
in reply to: andrew.nao

Is it Christmas yet?

Try this. It's from 1999.

command CS

Change Style.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 4 of 8
andrew.nao
in reply to: SomeBuddy

; error: Automation Error. Key not found

 

changing the font is what i want to do, but only on 1 text item while keeping the style and font for everything else the same

 

 

Message 5 of 8
Kent1Cooper
in reply to: andrew.nao


@andrew.nao wrote:

; error: Automation Error. Key not found

 

changing the font is what i want to do, but only on 1 text item while keeping the style and font for everything else the same 


Did you put an actual Style name in place of the "newstyle" in SomeBuddy's code?  It works for me if I do, but if I leave it saying "newstyle", it gives me that error message.

 

I wonder whether you're confused about the relationship between fonts and Styles, especially with the original question talking about "attempting to change the font style".  A font is an ingredient in a Style definition, and you can only assign a font to a piece of Text through the Style assigned to that Text.  If you want a Text entity to have a different font, you need to have a Style that uses that font, and assign that Style to the Text.

 

You can assign a different font, without the intermediary of a Style, to content within Mtext entities [or portions of it], but not to Text entities.

Kent Cooper, AIA
Message 6 of 8
andrew.nao
in reply to: Kent1Cooper

it worked after i removed the extension *smacks forehead*

 

oh ok, so i need to make a new style with the font i want instead of changing the font in the already existing style.

 

is it safe to assume that you cant have 2 different styles of text in the same dwg then?

Message 7 of 8
Kent1Cooper
in reply to: andrew.nao


@andrew.nao wrote:

.... 

is it safe to assume that you cant have 2 different styles of text in the same dwg then?


You can have as many as you want [well, there may be some way-beyond-what-you'd-ever-want limit].  Way back in the early days [when I started on AutoCAD Version 1.4 in 1984], you could have only one font in a drawing, but you could define more than one Style using it.  But that limitation is long gone.

Kent Cooper, AIA
Message 8 of 8
cadman777
in reply to: andrew.nao

Can someone tell me what causes and how to fix this problem?

 

When I "Save As" an Inventor 2010 idw file to an autocad dwg file, the font gets messed up this way:

The dwg "Style" shows the font as "romans" for the non-default text (the text note I added to the dimension in Inventor), but the default (="<>") shows another style (="RomanS_IV25"), being a font native to Inventor 2010, which I did NOT specify in the Inventor "Styles Editor" for my text entities.

 

This is messing up my drgs by making the plots show faint text where the "unauthorized" Inventor text is, so the shop and customer can't read the text strings. It happens when both dwg and pdf files are plotted.

 

Any help is appreciated ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost