解决了我自己的问题。
考虑到我在幼儿园的编程技能,有没有更好的方法来实现这一切?
- (defun c:swt (/ i s la lal len)
- (Princ
- "\nFinds all SolidWorks Text Styles, replaces with ROMANS Font:"
- )
- (setq la (cdr (assoc 2 (tblnext "STYLE" T))))
- (setq lal (list la))
- (while (/= (setq la (cdr (assoc 2 (tblnext "STYLE")))) nil)
- (setq lal (append lal (list la))
- )
- )
- (setq LEN (length lal))
- (if (not (tblsearch "STYLE" "ROMANS"))
- (progn
- (command "_.STYLE" "ROMANS" "ROMANS")
- (while (> (getvar "CMDACTIVE") 0)
- (command "")
- )
- )
- )
- (setq i 0)
- (repeat LEN ; All my LEN from the subroutine here
- (setq s (strcat "SLDTEXTSTYLE" (itoa i)))
- (if (tblsearch "STYLE" s)
- (progn
- (command "_.STYLE" s "ROMANS")
- (while (> (getvar "CMDACTIVE") 0)
- (command "")
- )
- )
- )
- (setq i (1+ i))
- )
- (princ)
- )
|