Hello Everyone –

I am looking for some help to create a lisp program to update a text style name.

Our company has several 1000 drawing that I need to rename a text style. The same style name is the same in different drawings formats (e.g. ‘A’, ‘B’ and ‘D’ size sheets). The properties of this style changes from drawing format to drawing format. I have 3 styles to change for each drawing format previously mentioned.

I believe I need to program to do the following:

  • Check to see if the style exists
  • If the style exists check the drawing format and rename accordingly
  • If the style does not exist do nothing


I use the useri5 system variable to determine the drawing format. I set a number to a variable called ‘size’. Please see below.
A = 1
B = 2
C = 3
D = 4
E = 5

Sample Code:

(if (= size 4) (tblsearch "STYLE" "Bordtxt")
(progn
(command "-RENAME" "_STYLE" "Bordtxt" "D_Bordertext1")
)
)


The code above does not use the 'size' variable and returns an error if the style does not exist.

This seems like it would be a simple enough task, but for some reason I’m having a brain fart. Any help would be greatly appreciated.

Thank you in advanced for your help with this.