Registered forum members do not see this ad.
Please post here scripts that can be described as one-click commands.
I hope these commands will be useful, mostly (but not only) while working in XYplane.
For example I'll post first one: 'Rotate90degrees'.
It is made by fixoand posted here as RS:
http://www.cadtutor.net/forum/showth...t=24888&page=2 post #19
I made slight modification to eliminate manual entering the rotation value.
It needs little tuning to work correctly with undo/redo but I don't know how and what to modify.;;rs.lsp
;;rotate selection set around its center 90 degrees
(vl-load-com)
)
(defun C:RS90 (/ a axss lp maxp minp midp points rot ss up)
(setq ss (ssget)
axss (vla-get-activeselectionset
(vla-get-activedocument
(vlax-get-acad-object))))
(vlax-for a axss
(if (not (vl-catch-all-error-p
(vl-catch-all-apply
(function (lambda ()
(vla-getboundingbox a 'minp 'maxp))))))
(setq points (append (list (vlax-safearray->list minp)
(vlax-safearray->list maxp))
points)
)
)
)
(setq lp (car (vl-sort points
(function (lambda (a b)
(and (< (car a) (car b))
(< (cadr a) (cadr b)))))))
up (car (vl-sort points
(function (lambda (a b)
(and (> (car a) (car b))
(> (cadr a) (cadr b)))))))
)
; (vla-zoomwindow
; (vlax-get-acad-object)
; (vlax-3d-point lp)
; (vlax-3d-point up)
; )
(setq midp (mapcar (function (lambda(a b)(/ (+ a b) 2.))) lp up))
(initget 3)
;;;;;;;;;;;;;;;;;;;;;;;;;(setq rot (getreal "\nEnter a rotation angle in degrees: "))
(vlax-for a axss
(vl-catch-all-apply
(function (lambda ()
(vla-rotate a (vlax-3d-point midp) (* 90 (/ PI 180))))))
)
(princ)
)
(prompt "\n >>> Type RS90 to execute...")
(prin1)
Now I'll ask again fixo to modify above and post here MIRROR-X(about X axis) and MIRROR-Y(about Y axis) using same start point (middle of selection set).
Last edited by tboy; 11th Jun 2010 at 01:56 pm.
Registered forum members do not see this ad.
The soul is healed by being with children. - Fyodor Dostoyevsky, novelist (1821-1881)
Bookmarks