求各位大神帮忙弄一下,
现在只能改一个选一下,我想一下子改完。
- (defun hs-tukuangmc ()
- "M")
- (defun c:h9 () ;修改命令
-
- (setq A (SSGET))
- ( LMSSK "零件件号" "D0-1" )
- ( LMSSK "零件名称" "入子" )
- ( LMSSK "零件材质" "SKH-9" )
- ( LMSSK "零件热处理" "60~62HRC%%D" )
- ( LMSSK "零件数量" "1 PCS" ))
- (defun LMSSK (bq cz / ss i s1 )
- (princ "\n请选择图框:")
- (setq ss (ssget ;"_C" pt1 pt2
- (list (cons -4 "<or") (cons 2 (hs-tukuangmc)) (cons -4 "OR>"))
- )
- )
- (setq i 0)
- (repeat (sslength ss)
- (setq s1 (ssname ss i))
- (setq i (1+ i))
- (hs-sxtx bq cz s1)
- )
- )
- (defun hs-sxtx ( pn text s1 / aa a1 x bb)
- (setq aa (vlax-safearray->list
- (vlax-variant-value
- (vla-GetAttributes (vlax-ename->vla-object s1))
- )
- )
- )
- (setq a1 (mapcar '(lambda (x)
- (cons (vla-get-Tagstring x) x)
- )
- aa
- )
- )
- (setq bb (cdr (assoc pn a1)))
- (vla-put-textstring bb text)
- )
|