您的位置:网站首页 > 设计杂谈

给ACAD加个旋转拷贝命令

时间:2008-07-24 20:31:23 来源:

给ACAD加个旋转拷贝命令

旋转拷贝命令

(defun c:rc (/ ent)

(princ "

笑一笑,世界变得更美妙! 我爱... 请选择旋转复制物体.")

(setq ent (ssget))

(command "copy" ent "" "@""@")

(command "rotate" ent "")

)

;单线变双线命令

(defun c:wa (/ yong shi ya yb xy yx xa xb )

(setq shi (ssget))

(SETQ DIA1 (getreal "请输入管的直径:"))

(if (= nil DIA1) (setq DIA1 DIA))

(SETQ DIA DIA1)

(SETQ DIA2 (/ DIA1 2))

(setq yang (ssname shi 0))

(setq yan (cdr(assoc 10(entget yang))))

(setq yong (entget yang))

(command "offset" DIA2 shi yan "")

(setq xy(cdr (assoc 10 yong)))

(setq xa(car xy))

(setq ya(cadr xy))

(setq yx(cdr (assoc 11 yong)))

(setq xb(car yx))

(setq yb(cadr yx))

(command "mirror" "l" ""(list xa ya)(list xb yb)"")

(command "erase" shi "")

)