;|BLKSTR.LSP by Paul Kirill, copyright 2002 Kirill Design - PC & CAD Consulting (KDCAD) Simple command line routine for stretching blocks along a specified axis. This routine is freely given and may be freely distributed as long as the Kirill Design copyright and contact info remains intact. There are no guarantees offered with this routine. KDCAD is not responsible for loss of data or work due to the use of this routine. If you have any questions or are interested in contracting for additional custom routines, email us at info@kdcad.com. NOTES: Unlike the SCALE command, the base point defaults to the block insertion point. The routine works by defining a scale factor based on two values you enter by either selecting points on the screen or by typing them at the command line. |; (princ "\nBLKSTR.LSP loaded successfully.Type BLKSTR to run...") ;; START Block Stretch (defun C:BLKSTR () (defun checkout (/ AXS ASSOC_NUM OSF NSF DIST_ORG DIST_NEW) (initget "X Y Z") (setq AXS (getkword "\nChoose your axis (X,Y,Z) : ") ) (if (= AXS nil) (setq AXS "Y") ) (cond ((= AXS "X") (setq ASSOC_NUM 41)) ((= AXS "Y") (setq ASSOC_NUM 42)) ((= AXS "Z") (setq ASSOC_NUM 43)) ) (setq OSF (cdr (assoc ASSOC_NUM BLK)) ) (setq DIST_ORG (getdist (strcat "\nPick original " AXS " value: ")) ) (setq DIST_NEW (getdist (strcat "\nPick NEW " AXS " value: ")) ) (setq NSF (/ OSF (/ DIST_ORG DIST_NEW)) ) (setq BLK (subst (cons ASSOC_NUM NSF) (assoc ASSOC_NUM BLK) BLK ) ) (entmod BLK) (princ "\nBLOCK STRETCH - c2002 KDCAD, inc.") (princ) ) (defun GETBLK () (setq BLK (ssget (list (cons 0 "INSERT"))) ) (if (< 1 (sslength BLK)) (progn (alert "One at a time please!") (getblk) ) (progn (setq BLK (entget (ssname BLK 0)) ) (checkout) ) ) ) (getblk) ) (princ "\nType BLKSTR to run...")