HLP: Changing Style with LSP

Mar 07, 2004 2 Replies

I've a self-made LSP file I wrote many years ago. I first select an 'existing' line of Text and my routine continues the Text on the next line.



This works fine for my companies 'default' font type (a non-standard Acad font). This font (ARCHQUIK.SHX) has 5 options after the 'name' when you use STYLE. However, IF I pick an existing font that is not my 'standard', and which has more, or less, options, my routine craps out.



This is part of my LISP file:



(princ "\nSelect First line of Text: ") (setq txt1 (entget (car (entsel)))) (setq txtht1 (cdr (assoc '40 txt1))) ; get height of selection (setq txtst1 (cdr (assoc '10 txt1))) ; get insert pt of selection (setq txtly1 (cdr (assoc '8 txt1))) ; get layer of selection (setq newdist (+ txtht1 (* txtht1 0.618))) ; suggested text line spacing (setq etxt (getvar "textstyle")) ; get exist Text Style



; set to existing selected text (setq ntxt (cdr (assoc '7 txt1))) ; GROUP 7 is Text Style - new (command "-style" ntxt "" txtht1 "" "" "N" "N")



The 'last' line is what can give me problems IF I select another font type.



QUESTION: Is there some way is LISP that will allow my to change my current Font without using the "-STYLE" command? So that regardless of Height, Oblique, etc. options, it will change?



Regards,



Bruce


Maybe (setvar "TEXTSTYLE" "...") will do what you need?

Juergen

"Mr. B" schrieb:

DUH! Oh am I an idiot :(

I've only been writting lisp's files for years... (silly me!)

Thanks!

Bruce

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required