Professional Documents
Culture Documents
Quick Mirror
Quick Mirror
;; ;;
;; Provides functionality to mirror a selection of objects ;;
;; or a single object without the need to select two points ;;
;; defining a mirror axis. ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright � 2011 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; single - if T, mirrors selected object using derivative ;;
;; at the selected edge to determine mirror axis, ;;
;; else prompts for selection set and object to use ;;
;; as mirror axis. ;;
;; delete - if T, selected object or selection set is ;;
;; deleted following the mirror operation. ;;
;;------------------------------------------------------------;;
;; Returns: Null. ;;
;;------------------------------------------------------------;;
;; Version 1.0 - 15-02-2011 ;;
;; ;;
;; First Release. ;;
;;------------------------------------------------------------;;
;;------------------------------------------------------------;;
;; Program Shortcuts ;;
;;------------------------------------------------------------;;
;;------------------------------------------------------------;;
;; Quick Mirror Subfunction ;;
;;------------------------------------------------------------;;
(setq p2
(polar p1
(angle '(0. 0. 0.)
(vlax-curve-getFirstDeriv (car sel)
(vlax-curve-getParamatPoint (car sel) p1)
)
)
1.
)
)
(_StartUndo doc)
(if ss
(repeat (setq i (sslength ss))
(vla-mirror (setq o (vlax-ename->vla-object (ssname ss (setq i (1-
i))))) p1 p2)
(if delete (vla-delete o))
)
(progn
(vla-mirror (setq o (vlax-ename->vla-object (car sel))) p1 p2)
(if delete (vla-delete o))
)
)
(_EndUndo doc)
)
)
)
)
)
(princ)
)
;;------------------------------------------------------------;;
;; End of File ;;
;;------------------------------------------------------------;;