Display full version of the post: scale block

lijinsong
07.12.2014, 10:52
; 1  specify base point scaling.(defun c:tt() (princ "\n Choose the arrow block") (setq en(entsel)) (if en(progn (setq enn(car en)           enpt(getpoint" input scaling point")           sfx(getreal" input scaling coefficient: ") ) (vla-getboundingbox (vlax-ename->vla-object enn) 'enpt1 'enpt2)  (setq enpt1 (vlax-safearray->list enpt1)        enpt2 (vlax-safearray->list enpt2)       enmp  (mapcar '(lambda(x y)(/(+ x y)2))enpt1 enpt2)       endi  (distance enpt enmp)       enan  (angle enpt enmp)       szj   (ssget)       l     (sslength szj)        n     0 ) (repeat l  (setq szjenn(ssname szj n))  (vla-getboundingbox (vlax-ename->vla-object szjenn) 'szjpt1 'szjpt2)   (setq szjpt1 (vlax-safearray->list szjpt1)         szjpt2 (vlax-safearray->list szjpt2)        szjmp  (mapcar '(lambda(x y)(/(+ x y)2))szjpt1 szjpt2)        szjpt  (polar szjmp enan endi)        n      (1+ n )    )  (vl-cmdf "scale" szjenn "" "non"szjpt sfx ) ) ));2scale same name of Block .(defun c:tt()  (SETQ b1 (ENTSEL "\nPlease select the block: ") i  0         hh (getreal"Enter the new scaling coefficient:  ")  )   (IF b1        (PROGN         (SETQ b2 (CAR b1)               b3 (ENTGET b2)              b4 (ASSOC 0 b3)              b5 (CDR b4)        )     (IF (= b5 "INSERT")        (PROGN           (SETQ b6 (ASSOC 2 b3)               b7 (CDR b6)               b8 (SSGET (LIST b4 b6))              b9 (SSLENGTH b8)                     )       (alert (strcat b7 "  *  " (itoa b9)))      )          (PRINC "\nObject is not a block!")       )         )         (PRINC "\nNo selection block!")    )      (repeat  b9     (setq bb(ssname b8 i) instp(cdr(assoc 10 (entget bb))))     (command "scale" bb "" "non"instp hh )     (setq i(1+ i))   )  (PRINC))3 “Polygon single line text center”  -i do not know why some dwg use it will failure.(defun C:tt()       (setq ss  (ssget ":E:S" )             en  (ssname ss 0 )            vo  (vlax-ename->vla-object en)    )    (vlax-invoke-method vo 'GetBoundingBox  'MinPoint 'MaxPoint  )     (setq p1  (vlax-safearray->list  MinPoint)          P2  (vlax-safearray->list  MaxPoint )          mp  (mapcar'(lambda(x y)(/(+ x y)2))p1 p2)    )    (command "-boundary" "non"p1 "" )    (setq PL (entlast)               vo(vlax-ename->vla-object PL)    )    (vlax-invoke-method vo 'GetBoundingBox 'MinPoint 'MaxPoint  )    (setq  p1(vlax-safearray->list  MinPoint)           P2(vlax-safearray->list  MaxPoint)           mpL (mapcar'(lambda(x y)(/(+ x y)2))p1 p2)    )    (command "_move" ss"" "non"mp "non"mpL))

John Connor
07.12.2014, 13:20
So what's all this garbage?I would not run any of your code until a full explanation of each routine is added to every post you've made. 

lijinsong
07.12.2014, 15:34
He he, I know you are a master, is also a chinese too. Don't be so serious, Like watching a movie, You think it plays good, then it is good.  You think it plays bad,then it is bad. 

John Connor
07.12.2014, 18:49
Why do I need a lisp routine to scale a block?  Invoke the SCALE command and select the block.  What is the advantage of your lisp routine?It would be helpful if you explained what your lisp routine is supposed
to do and give a real world example of the routine in use.  A video
demonstration of the routine in action would be best.
John Connor2014-12-08 12:04:17