@janu319 ,
This code is not working because there was some misinterpretation between @ВeekeeCZ and you.
Bee's code takes text on a LAYER and STYLE then changes HEIGHT.
You are looking for a code that takes LAYER then changes STYLE and HEIGHT.
So, when you run Bee's code, it does not find any text with the style of "TextStyle1" (thank you for the picture btw).
I made some edits and I think this code is what you're looking for. I have not tested yet, but should work.
(defun SetStyleHeightByLayer (lyr sty hgt / ssT cnt e)
(if (and (setq ssT (ssget "_A" (list '(0 . "*TEXT") (cons 8 lyr))))
(setq sty (tblobjname "STYLE" sty)))
(repeat (setq cnt (sslength ssT))
(setq e (ssname ssT (setq cnt (1- cnt))))
(setpropertyvalue e "TextStyleId" sty)
(setpropertyvalue e "Height" hgt) t ;<--this 't' is return value
);repeat
;else
(prompt "\nNothing performed. Check for text and text style. Then try again.")
);if
);defun
EDIT:
Looks like BeekeeCZ just posted update! Sorry, not trying to intrude. Now you should have 2 codes to approach with!
Best,
~DD