- ;块替换,作者:【KAIXIN】,QQ:295963716
- ;本程序需要KAIXIN通用函数的支持
- (DEFUN C:XX (/ S1 BLKNAME SS X)
- (KX-COMA)
- (KX-princA "块替换")
- (setvar "osmode" 0)
- (SETQ s1 (KX-GET-entsel '((0 . "INSERT")) "源块"))
- (setq BlkName (KX-get-dxf 2 (CAR s1)))
- (KX-princ "要替换的图块")
- (while(setq ss (ssget":s" (list (cons 0 "INSERT"))))
- (setq X -1 )
- (while (setq s1 (ssname ss (setq X (1+ X))))
- (KX-PUT-DXF s1 2 BlkName)
- )
- )
- (KX-COMB)
- )
|