alanjt Posted May 20, 2010 Posted May 20, 2010 @alanjt: Chapeau! I'm going to assume that's a compliment. Here's one with the option to scale by center or insertion point. (defun c:SB (/ ss scale flag a b) ;; Scale blocks by Center or Insertion point ;; Alan J. Thompson, 05.20.10 (vl-load-com) (or *SB:Option* (setq *SB:Option* "Insertion")) (if (and (setq ss (ssget "_:L" '((0 . "INSERT")))) (setq scale (getreal "\nSpecify Scale Factor: ")) (not (initget 0 "Center Insertion")) (setq *SB:Option* (cond ((getkword (strcat "\nScale by [Center/Insertion] <" *SB:Option* ">: "))) (*SB:Option*) ) ) ) (progn (setq flag (not (vla-startundomark (cond (*AcadDoc*) ((setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))) ) ) ) ) (vlax-for x (setq ss (vla-get-activeselectionset *AcadDoc*)) (vla-getboundingbox x 'a 'b) (vl-catch-all-apply (function vla-scaleentity) (list x (if (eq *SB:Option* "Center") (vlax-3d-point (mapcar (function (lambda (x y) (/ (+ x y) 2.))) (vlax-safearray->list a) (vlax-safearray->list b) ) ) (vla-get-insertionpoint x) ) (abs scale) ) ) ) (vla-delete ss) (and flag (vla-endundomark *AcadDoc*)) ) ) (princ) ) Quote
vards01 Posted May 20, 2010 Author Posted May 20, 2010 Hi alanjt.....I can not seem to get the lisp file to run you have there..... Quote
alanjt Posted May 20, 2010 Posted May 20, 2010 Hi alanjt.....I can not seem to get the lisp file to run you have there..... Too vague. :wink: Don't know how to load it or can't get it to work, upon loading? Use/Load LISP Routines Quote
vards01 Posted May 20, 2010 Author Posted May 20, 2010 Hi alanjt, I have finished work now.....so hope I'll get it going tomorrow, thanks for your help, Ian Quote
vards01 Posted May 21, 2010 Author Posted May 21, 2010 Hi, Still can not get this one to work. I have called the file SB.lsp, load the file and get nothing when I type SB in the command line? Probably something I'm doing wrong as I'm new to lsp commands! Wish I'd used these sooner I've been on CAD since R13! Quote
vards01 Posted May 21, 2010 Author Posted May 21, 2010 Not to sure why this will not load properly, MSASU's lisp file loads fine and runs, but alanjt's lisp code states loaded succuessfully but obviously doesn't as when I go back to check if its loaded its not listed. Any ideas? Quote
alanjt Posted May 21, 2010 Posted May 21, 2010 When you say you load it, are you using appload and loading it or adding it to your startup suite? Also, what does it return when you type SB at the commandline? Quote
vards01 Posted May 21, 2010 Author Posted May 21, 2010 I load it by the link posted here on how to load. I type SB and I get 'unknown command'. But when I go back to check if the SB.lsp file is loaded it is not, so really confused as it retains the lisp file submitted by msasu just not SB.lsp Quote
vards01 Posted May 21, 2010 Author Posted May 21, 2010 yes I am, but states successfully loaded, I go back in to check as it does not work and it has disappeared? Quote
vards01 Posted May 21, 2010 Author Posted May 21, 2010 just checked command window, I get application loaded successfully followed by malformed list on input Quote
alanjt Posted May 21, 2010 Posted May 21, 2010 just checked command window, I get application loaded successfully followed by malformed list on input Ah hah! That means you missed copying a paren. Recopy what I posted and try again. Quote
vards01 Posted May 21, 2010 Author Posted May 21, 2010 Absolute genius......what a time saver this is for me, Thankyou very much indeed! Quote
alanjt Posted May 21, 2010 Posted May 21, 2010 Absolute genius......what a time saver this is for me, Thankyou very much indeed! I wish I could get a piece of that time saved. Enjoy and you're welcome. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.