- (defun c:z90 (/ *error* X selection doc obj)
- (defun *error* (s) (command-s ".UCS" "P") (princ))
- (vl-load-com)
- (setq X (* pi 0.5))
- (setq selection (ssget '((0 . "INSERT,TEXT"))))
- (if selection
- (progn
- (command ".UCS" "W")
- (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
- (foreach obj (vl-remove-if-not '(lambda (x) (= (type x) 'ENAME)) (mapcar 'cadr (ssnamex selection)))
- (setq obj (vlax-ename->vla-object obj))
- (if (= :vlax-false (vla-get-Lock (vla-item (vla-get-Layers doc) (vla-get-Layer obj))))
- (vla-put-Rotation obj X)
- )
- )
- (command ".UCS" "P")
- (princ "\n选定的对象已旋转。")
- )
- )
- (princ)
- )
|