- 积分
- 19100
- 明经币
- 个
- 注册时间
- 2003-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-12-27 09:00:00
|
显示全部楼层
剛看你的貼, 剛寫一個, 可以合你用的,試試看 . 呵呵 :D
ROGRAM MAKE DATE 2003-12-27
(defun c:test( / blockname os ss ssa scale i a pt1)
(setq os (getvar "osmode"))(setvar "osmode" 0)(setvar "cmdecho" 0)
(setq blockname (getstring "\n請輸入要scale圖塊的名或回車選擇塊:"))
(if (= blockname "")
(setq ss (ssget '((0 . "INSERT"))))
(setq ssa (ssget "x" (LIST (CONS 0 "INSERT")(CONS 2 blockname)))))
(IF (= ssa nil )(setq ssa (ssget "x" (LIST (CONS 0 "INSERT")(assoc 2 (entget(ssname ss 0)))))))
(setq scale (getdist "\n輸入縮放比例:"))
(setq i 0)
(command "_.undo" "_group")
(Repeat (sslength ssa)
(setq a (ssname ssa i))
(setq pt1 (cdr (assoc 10 (entget a))))
(command ".scale" a "" pt1 scale )
(setq i (1+ i)))
(command "_.undo" "_end")
(setvar "osmode" 1)(setvar "cmdecho" 1)
(princ "\r進行同名塊縮放功能運行成功了, 歡迎使用哦.")
(princ)) |
|