sergiu_ciuhnenco Posted January 22, 2016 Share Posted January 22, 2016 (edited) (defun c:CS ( / a d d1 num ) (defun *error* (msg) (setq a nil d nil d1 nil num nil)(princ) );end** (if (not usercs) (setq usercs (getvar "textstyle")) );if (setq a (strcase (getstring (strcat "Change Style (New style)[" usercs "]: ")))) (if (> (strlen a) 0) (progn (while (not (tblsearch "style" a)) (setq a (getstring "\nInvalid style. Enter style: ")) );while (setq usercs a)(setq a nil) );progn );if (if (setq d (ssget "X" '( (0 . "TEXT")))) (progn (setq num 0) (while (< num (sslength d)) (setq d1 (entget (ssname d num))) (entmod (subst (cons 7 usercs) (assoc 7 d1) d1)) (setq num (1+ num)) );while (princ (strcat (itoa num) " object(s) to style " usercs ".")) (setq d nil d1 nil num nil) );progn (princ "None selected. ") );if (princ) );endCS This is a lisp for changing text style for text ... could somebody help me to modify it , I need : to do not create a new style , just use : "usercs " (standard) style, without hitting enter ,I use it in combination with other lisps , sometimes I mix the consecutivity of them , thanks in advance Edited January 22, 2016 by sergiu_ciuhnenco Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted January 22, 2016 Share Posted January 22, 2016 ... to do not create a new style , just use : "usercs " (standard) style, without hitting enter ... hi, just remove these (setq a (strcase (getstring (strcat "Change Style (New style)[" usercs "]: ")))) (if (> (strlen a) 0) (progn (while (not (tblsearch "style" a)) (setq a (getstring "\nInvalid style. Enter style: ")) );while (setq usercs a)(setq a nil) );progn );if also, you've already localized these variables - a d d1 num so not necessary for this (setq d nil d1 nil num nil) Quote Link to comment Share on other sites More sharing options...
BKT Posted January 22, 2016 Share Posted January 22, 2016 Bear in mind that with "usercs" set to (getvar "textstyle") text will be set to the current style. If you want to change the text to "Standard" while disregarding the current style you would need to set "usercs" to "Standard". Quote Link to comment Share on other sites More sharing options...
sergiu_ciuhnenco Posted January 23, 2016 Author Share Posted January 23, 2016 Work fine now , thanks again for advices guys !!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.