bijoyvm Posted April 23, 2012 Share Posted April 23, 2012 hi, I'm looking for a lisp which similer to MICROSTATION command "Scale about element center". Sometimes its very useful when we are using polyline, circles and polygons instead of blocks. more detail about microstation command please check this below link http://www.cadlispandtips.com/2012/01/ms-tip-scale-about-element-center.html thanks & regards Bijoy.v.m Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 23, 2012 Share Posted April 23, 2012 Look at this thread. http://www.cadtutor.net/forum/showthread.php?38383-Autocad-Lisp-For-Scaling-Down-up-From-Center Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 23, 2012 Share Posted April 23, 2012 Here is a generalisation of the code in that thread: ;; Scale About Center - Lee Mac (defun c:sac ( / ll sel obj ur ) (initget 6) (if (and (setq *scl* (cond ( (getdist (strcat "\nSpecify Scale Factor" (if *scl* (strcat " <" (rtos *scl* 2) ">: ") ": ")))) ( *scl* ) ) ) (ssget "_:L") ) (progn (vlax-for obj (setq sel (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)))) (if (null (vl-catch-all-error-p (vl-catch-all-apply 'vla-getboundingbox (list obj 'll 'ur)))) (vla-scaleentity obj (vlax-3D-point (mapcar '(lambda ( a b ) (/ (+ a b) 2.0)) (vlax-safearray->list ll) (vlax-safearray->list ur) ) ) *scl* ) ) ) (vla-delete sel) ) ) (princ) ) (vl-load-com) (princ) Quote Link to comment Share on other sites More sharing options...
bijoyvm Posted April 23, 2012 Author Share Posted April 23, 2012 (edited) that's the one Im looking for... Thank you so much lee & remark Lee, can you add this lisp to www.lee-mac.com beacuse lots of cad users need this one. thanks again bijoy.v.m Edited April 23, 2012 by bijoyvm Quote Link to comment Share on other sites More sharing options...
wary faraj Posted September 10, 2012 Share Posted September 10, 2012 Thank you very much dude you are great too Mr. Lee... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 11, 2012 Share Posted September 11, 2012 Thank you wary faraj, I'm glad it helps. Quote Link to comment Share on other sites More sharing options...
mmuslih84 Posted October 19, 2012 Share Posted October 19, 2012 it's very useful. Thanks for shared. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 19, 2012 Share Posted October 19, 2012 it's very useful. Thanks for shared. You're welcome! Quote Link to comment Share on other sites More sharing options...
Madruga_SP Posted July 11, 2016 Share Posted July 11, 2016 You're welcome! Hi Lee, The sac's code is fantastic!! Your code isn't working for blocks? Because I have thousand block into my drawing and I'd like to change the scale. Thanks test.dwg Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 12, 2016 Share Posted July 12, 2016 If your happy with scale about insertion point then its easy just use a ssget the right blocks and change the scale. Your dwg gives no hints to what you want. ; a roughy (defun c:test (/ sc ss x) (setq sc (Getreal "\nEnter scale")) (setq ss (ssget "x" (list(cons 0 "INSERT")))) (repeat (SETQ X (SSLENGTH SS)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (vla-put-XScaleFactor obj sc) (vla-put-YScaleFactor obj sc) ) ) (c:test) Quote Link to comment Share on other sites More sharing options...
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.