(defun c:tt ()
(princ "\n选择实体: ")
(if (setq ss (ssget))
(progn
(setq p1 (xyp-9pt ss 5))
(if (setq p2 (getpoint p1 "\n指定镜像方向<退出>: "))
(progn
(setq p3 (polar p2 (+ (angle p1 p2) (* pi 0.5)) 10)
ss0 (ssget "x")
)
(command "mirror" ss "" p2 p3 "n")
(command "select" "all" "r" ss0 "")
(setq ss1 (ssget "p")
pt (xyp-9pt ss1 5)
bname (substr (rtos (getvar 'cdate) 2 8) 10 8)
)
(command "-block" bname "non" pt ss1 "")
(command "-insert" bname "non" pt "" "" "")
)
)
)
)
(princ)
) 本帖最后由 李青松 于 2014-7-2 09:33 编辑
xyp1964 发表于 2014-7-1 22:46 static/image/common/back.gif
运行不了
选择对象:
; 错误: no function definition: XYP-9PT
要默认打开正交,不要搞斜向镜像,斜向镜像时我可以用捕捉。 块的基点默认在原点也可以,反正不要在屏幕上指定。
你那个镜像是以所指定线的中心垂直线作为镜像线。不要用这种方式。用程序默认的方式就可以了。
望调整。
我一般用来搞家具镜像。
李青松 发表于 2014-7-2 09:25 static/image/common/back.gif
运行不了
选择对象:
; 错误: no function definition: XYP-9PT
;; tt(镜像成块)
(defun c:tt ()
(princ "\n选择实体: ")
(if (and (setq ss (ssget))
(setq p1 (getpoint "\n指定垂直镜像线点<退出>: "))
)
(progn
(setq p2 (polar p1 (* pi 0.5) 10)
ss0 (ssget "x")
)
(command "mirror" ss "" "non" p1 "non" p2 "n")
(command "select" "all" "r" ss0 "")
(setq ss1 (ssget "p")
bname (substr (rtos (getvar 'cdate) 2 8) 10 8)
pt (xyp-9pt ss1 1)
)
(command "-block" bname "non" pt ss1 "")
(command "-insert" bname "non" pt "" "" "")
)
)
(princ)
) xyp1964 发表于 2014-7-2 12:36 static/image/common/back.gif
; 错误: no function definition: XYP-9PT
点2点做为镜像线,有时候是上下镜像,有时候是左右镜像,斜着镜像的时候可以用捕捉。正交是默认的。
上面的程序运行后,镜像后的对象没有成为块。
页:
1
[2]