;;;*************************** RotSclSS.LSP *************************** ;;; Purpose: Implements following commands: FLIPSS ROTSS SCALESS ;;; Ref: command headers for description ;;; Author: Herman Mayfarth ;;; http://www.tktn.com ;;; Copyright (c) 1999 Herman Mayfarth. All rights reserved. ;;; Provided as is and without warranty. ;;; Permission granted to freely use and redistribute without ;;; fee provided this notice remains intact. ;;;******************************FLIPSS.lsp**************************** ;;; ;;; Purpose: Mirrors a selection set of INSERTs about their respective ;;; Y axes & deletes original entities. ;;; ;;;******************************************************************** (defun C:FLIPSS ( / ss1 i pt1 pt2 rtd) (defun rtd (ang) (* ang (/ 180 pi))) (command "_.UNDO" "BEGIN") (princ "\nSelect Blocks to Mirror: ") (while (null ss1) (setq ss1 (ssget '((0 . "INSERT")))) ) (setq i 0) (setvar "OSMODE" (logior (getvar "OSMODE") 16384)) (repeat (sslength ss1) (setq ent (ssname ss1 i) pt1 (trans (cdr (assoc 10 (entget ent))) 0 1) pt2 (subst (+ 10 (cadr pt1)) (cadr pt1) pt1) ) (command "_.MIRROR" ent "" pt1 pt2 "YES") (setq i (1+ i)) );repeat (setvar "OSMODE" (logand (getvar "OSMODE") 16383)) (command "_.UNDO" "END") (princ) );defun ;;;******************************rotSS.lsp*************************** ;;; ;;; Purpose: Rotates a selection set of INSERTs about their respective ;;; insertion points. ;;; ;;;******************************************************************** (defun C:ROTSS ( / ss1 rotang i rtd) (defun rtd (ang) (* ang (/ 180 pi))) (command "_.UNDO" "BEGIN") (princ "\nSelect Blocks to Rotate: ") (while (null ss1) (setq ss1 (ssget '((0 . "INSERT")))) ) (setq rotang (rtd (getangle "Rotation Angle: "))) (setq i 0) (setvar "OSMODE" (logior (getvar "OSMODE") 16384)) (repeat (sslength ss1) (setq ent (ssname ss1 i)) (command "_.ROTATE" ent "" (cdr(assoc 10 (entget ent))) rotang) (setq i (1+ i)) );repeat (setvar "OSMODE" (logand (getvar "OSMODE") 16383)) (command "_.UNDO" "END") (princ) );defun ;;******************************scaleSS.lsp*************************** ;;; ;;; Purpose: Scales a selection set of INSERTs about their respective ;;; insertion points. ;;; ;;;******************************************************************** (defun C:SCALESS ( / ss1 sf i) (command "_.UNDO" "BEGIN") (princ "\nSelect Blocks to Rescale: ") (while (null ss1) (setq ss1 (ssget '((0 . "INSERT")))) ) (setq sf (getdist "Scale factor: ")) (setq i 0) (setvar "OSMODE" (logior (getvar "OSMODE") 16384)) (repeat (sslength ss1) (setq ent (ssname ss1 i)) (command "_.SCALE" ent "" (cdr(assoc 10 (entget ent))) sf) (setq i (1+ i)) );repeat (setvar "OSMODE" (logand (getvar "OSMODE") 16383)) (command "_.UNDO" "END") (princ) );defun (princ "\nRotSclSS loaded.") (princ)