马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×

- ;;改造mirror
- ;;说明 使用前加载须加载highflybird的程序Matrix-Lib.LSP
- ;;By 自贡黄明儒 2013年9月30日 仅练习而已
- (defun c:MyMi (/ CODE LOOP P1 P2 SS)
- (defun line (p1 / ENT el P10 P11 P2 SS)
- (setq ss (ssget "c" p1 p1 '((0 . "LINE"))))
- (cond ((and ss (= 1 (sslength ss)))
- (setq ent (ssname ss 0))
- (setq el (entget ent))
- (setq p10 (cdr (assoc 10 el)))
- (setq p11 (cdr (assoc 11 el)))
- (if (equal p10 p1 0.001)
- (setq p2 p11)
- (setq p2 p10)
- )
- )
- (T (setq p2 (getpoint p1 "\n >>指定镜像线的第二点: ")))
- )
- p2
- )
- (defun block (ent / EL MAT1 P1 P10 P11 P2)
- (setq el (entget (car ent)))
- (cond ((equal '(0 . "LINE") (assoc 0 el))
- (setq p10 (cdr (assoc 10 el)))
- (setq p11 (cdr (assoc 11 el)))
- (setq Mat1 (caddr ent))
- (setq p10 (mat:mxp mat1 p10))
- (setq p11 (mat:mxp mat1 p11))
- (if (equal p10 p1 0.001)
- (setq p2 p11)
- (setq p2 p10)
- )
- )
- (T (setq p2 (getpoint p1 "\n >>指定镜像线的第二点: ")))
- )
- p2
- )
- (defun HH:GetP2 (p1 / ENT)
- (setq ent (nentselp "" p1))
- (cond ((not ent) (getpoint p1 "\n >>指定镜像线的第二点: "))
- ((= (length ent) 2) (line p1))
- ((= (length ent) 4) (Block ent))
- )
- )
- (if (setq ss (cadr (ssgetfirst)))
- nil
- (setq ss (ssget))
- )
- (and ss
- (setq p1 (getpoint "\n >指定镜像线的第一点: "))
- (setq p2 (HH:GetP2 p1))
- (princ "\n >>>左键删除源对象,右键保留源对象")
- (or (while (not loop)
- (setq code (car(grread T 8)))
- (cond
- ((= code 3) (setq loop code))
- ((= code 11) (setq loop code))
- ((= code 25) (setq loop code))
- ) ;cond
- )
- T
- )
- (cond ((= code 3) ;_Mouse Left button 如果=3为左键
- (command "_.mirror" ss "" p1 p2 "Y");可用highflybird的矩阵
- )
- (T ;_Mouse Right button 如果=11为右键
- (command "_.mirror" ss "" p1 p2 "N")
- )
- )
- )
- (princ)
- )
|