- ;; 伪源码需要e派工具箱(XCAD)的支持
- ;; 梁编号数字增减
- (defun c:tt (/ co ss i s1 tx n1 n2 tx1 tx2 tx3)
- (setq int (Uint 3 "" "增减数字" int)
- co (if (> int 0)
- 4
- 1
- )
- )
- (princ "\n选择梁编号文本: ")
- (if (setq ss (ssget '((0 . "TEXT") (1 . "*L-* *x,*L-* *X*,*L-* *×"))))
- (progn
- (setq i -1)
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq tx (xyp-get-dxf 1 s1)
- n1 (vl-string-search "-" tx)
- n2 (vl-string-search "(" tx)
- tx1 (substr tx 1 (+ n1 1))
- tx2 (substr tx (+ n1 2) (- n2 n1 1))
- tx3 (substr tx (+ n2 1))
- tx2 (itoa (+ (atoi tx2) int))
- tx (strcat tx1 tx2 tx3)
- s1 (xyp-SubUpd s1 1 tx)
- )
- (xyp-put "color" s1 co)
- )
- )
- )
- (princ)
- )
|