麻烦大神看看,框选填充
框选填充,B为我要的结果,能够框选填充,麻烦大神看看,谢谢麻烦大佬改一下,要求重命名前 ,可以定义块名,然后可以框选而非全部
(defun C:BN ( / blist bl b n)
(setq blist '() bl nil b 0 n "BK111-")
(while (setq bl (tblnext "block" (not bl)))
(and (zerop (logand 53 (cdr (assoc 70 bl))))
(not (wcmatch "`**" (setq bl (cdr (assoc 2 bl)))))
(or (member bl blist) (setq blist (cons bl blist)))
)
)
(while (and (car blist) (setq b (1+ b)))
(command "_.-rename" "_b" (car blist)
(strcat n (if (< b 10) "0" "") (itoa b)))
(setq blist (cdr blist))
)
(princ)
)
看一看是怎么回事 xudi1234 发表于 2022-8-23 14:34
麻烦大佬改一下,要求重命名前 ,可以定义块名,然后可以框选而非全部
****************************************************
; bth--块替换
;
;*****************************************************
;****************************************************块替换
(defun C:bth ()
(setvar "osmode" 0)
(princ "\n请选择作为源块的图块:")
(setq a1 (ssget (list (cons 0 "insert"))))
(setq stent (ssname a1 0))
(setq stent (entget stent))
(setq insname (assoc 2 stent))
(setq insname (cdr insname))
(princ insname)
(princ "\n请选择将替换的图块:")
(setq a (ssget (list (cons 0 "insert"))))
(if (/= a nil)
(progn
(setq n (sslength a))
(setq index 0)
(repeat n
(setq foent (ssname a index))
(setq ent1 (entget foent))
(setq index (+ index 1))
(setq inspt (assoc 10 ent1))
(setq inspt (list (nth 1 inspt) (nth 2 inspt)))
(setq insang1 (assoc 50 ent1))
(setq insang (cdr insang1))
(if (/= insang 0)
(setq insang (/ (* insang 180) pi))
)
(command "erase" foent "")
(command "insert" insname inspt 1 1 insang "")
)
)
)
(setvar "osmode" 687)
(princ)
)
song宋_74729 发表于 2022-8-26 09:43
****************************************************
; bth--块替换
; ...
支持动态块保留属性的替换吗?
页:
[1]