本帖最后由 x_s_s_1 于 2013-1-14 12:07 编辑
写了个复制的
- (defun c:test1 (/ str lt ss pt1 pt2 ang n obj)
- (setq str (getstring t "\n输入间距|用,或空格分开|,回车结束:"))
- (if (vl-string-search "," str)
- (setq lst
- (read
- (strcat "("
- (vl-list->string (subst 32 44 (vl-string->list str)))
- ")"
- )
- )
- )
- (setq lst (read (strcat "(" str ")")))
- )
- (prompt "\n选择需复制图元")
- (setq ss (ssget))
- (setq pt1 (getpoint "\n方向起点:"))
- (setq pt2 (getpoint pt1 "\n方向终点:"))
- (setq ang (angle pt1 pt2))
- (repeat (setq N (sslength ss))
- (setq obj (vlax-ename->vla-object (ssname SS (1- n))))
- (mapcar '(lambda (x)
- (setq obj (vla-copy obj))
- (vla-move obj
- (vlax-3D-point pt1)
- (vlax-3D-point (setq pt1 (polar pt1 ang x)))
- )
- )
- lst
- )
- (setq N (1- N))
- )
- (princ)
- )
|