;连续复制,需要Express Tool支持
- (defun c:cc (/ *error* redrawss ss0 p0 ss1 p1 v tmp)
- (vl-load-com)
- (defun redrawss (ss mode / m n)
- (setq m (sslength ss) n 0)
- (repeat m (redraw (ssname ss n) mode) (setq n (1+ n)))
- )
- (or *adoc* (setq *adoc* (vla-get-ActiveDocument (vlax-get-acad-object))))
- (vla-endundomark *adoc*)
- (vla-startundomark *adoc*)
- (if (and (setq ss0 (ssget))(setq p0 (getpoint "\n指定基点:")))
- (progn
- (setq snap (getvar "osmode"))
- (command ".COPY" ss0 "" p0 p0)
- (setq ss1 ss0 v nil)
- (redrawss ss1 3)
- (while ss1
- (initget "R S D T E")
- (setq p1 (acet-ss-drag-move ss1 p0 (strcat "\n点取位置,或[转90度(R)/左右翻(S)/上下翻(D)/改基点(T)/退出(E)]<"(if v "重复上次" "退出")">:") 1 0))
- (if (and(not p1)v)(setq p1 (mapcar '+ p0 v)))
- (cond
- ((eq p1 "R")(command ".ROTATE" ss1 "" p0 "90") (redrawss ss1 3))
- ((eq p1 "S")(command ".MIRROR" ss1 "" p0 (list (car P0) (+ (cadr P0) (getvar 'viewsize))) "Y")(redrawss ss1 3))
- ((eq p1 "D")(command ".MIRROR" ss1 "" p0 (list (+ (car P0)(getvar 'viewsize))(cadr P0)) "Y") (redrawss ss1 3))
- ((eq p1 "T")(if(setq tmp (getpoint p0 " 指定新基点:")) (setq p0 tmp)) (redrawss ss1 3))
- ((eq p1 "E")(command ".ERASE" ss1 "")(setq ss1 nil)(setvar "osmode" snap))
- ((listp p1)
- (setvar "osmode" 0)
- (command ".move" ss1 "" p0 p1)
- (setq v (mapcar '- p1 p0) p0 p1 ss0 ss1)
- (command ".COPY" ss0 "" p0 p0)
- (setq ss1 ss0)
- (redrawss ss1 3)
- (setvar "osmode" snap)
- )
- )
- )
- (setvar "osmode" snap)
- )
- )
- (vla-endundomark *adoc*)
- (princ)
- )
|