本帖最后由 自贡黄明儒 于 2022-5-11 18:12 编辑
用AL命令吧,一次到位。
- ;;11 移动+旋转
- (defun HH:MRotate (/ APP DOC P1 P2 P3 SS)
- (setq app (vlax-get-acad-object))
- (setq doc (vla-get-ActiveDocument app))
- (vla-StartUndoMark doc)
- (and (setq ss (ssget))
- (setq p1 (getpoint "\n 移动基点:"))
- (princ "\n 对齐点:")
- (command "_.move" ss "" p1 pause)
- )
- (setq p3 (getvar "LASTPOINT"))
- (setq p2 (getpoint "\n 旋转起点:"))
- (and p1
- p2
- p3
- (command "_.ROTATE" ss "" p3 "R" p3 p2 pause)
- )
- (vla-EndUndoMark doc)
- (vlax-release-object doc)
- (vlax-release-object app)
- (princ)
- )
|