change block scale

change block scale

CraigP_
Enthusiast Enthusiast
363 Views
4 Replies
Message 1 of 5

change block scale

CraigP_
Enthusiast
Enthusiast

Why does this only change the scale of 1 block in the selection set?

There are 5 blocks in the drawing in question.

Coincidently it only scales the block whose name comes last alphabetically.

 

(defun c:TEST (/ sc)
  (setvar 'cmdecho 0)
 (setq ss (ssget "_X" '((0 . "INSERT") (2 . "BIOA1_v*,LNO_BHPB_A1,NW_BHPB*"))))
  (setq sc (getreal "\nSpecify scale [1/2/5/10/15/20/25]:"))
 (if ss
    (progn
      (setq blk (vlax-ename->vla-object (ssname ss 0)))
      (vlax-put-property blk 'XEffectiveScaleFactor sc)
      (vlax-put-property blk 'YEffectiveScaleFactor sc)
      (vlax-put-property blk 'ZEffectiveScaleFactor sc)
      )
    )
  (setvar 'cmdecho 1)
  (princ)
)

 

thanks

Craig
0 Likes
364 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

Look HERE  how to process a selection set

0 Likes
Message 3 of 5

CraigP_
Enthusiast
Enthusiast

Thanks, I'll have a read and see how I go.

Craig
0 Likes
Message 4 of 5

ronjonp
Mentor
Mentor

@CraigP_ You also don't need the cmdecho lines since you're not using command calls.

0 Likes
Message 5 of 5

CraigP_
Enthusiast
Enthusiast

Thanks for this tip

Craig
0 Likes