script to change Y Scale of block

script to change Y Scale of block

Anonymous
Not applicable
1,537 Views
4 Replies
Message 1 of 5

script to change Y Scale of block

Anonymous
Not applicable

I want to change Y scale factor of all blocks in my drawing...
I try to find a little lisp code to do that but I've no success...
How can I do this changing in a script ?
Thanks !
Jé'

0 Likes
Accepted solutions (2)
1,538 Views
4 Replies
Replies (4)
Message 2 of 5

Ranjit_Singh
Advisor
Advisor
Accepted solution

I am not sure how you will do it through a script. The below lisp will change the y scales. Now all you have to do is call the lisp through your script.

(defun c:chysc (/ b ss1)
     (setq b (getreal "\nEnter new Y scale for blocks :"))
     (setq ss1 (ssget "_x" '((0 . "INSERT"))))
     (mapcar '(lambda (x)
                   (setq entdata (entget (cadr x)))
                   (entmod (setq entdata (subst (cons 42 b) (assoc 42 entdata) entdata)))
                   ) ;_ lambda
             (member (nth (- (sslength ss1) 1) (ssnamex ss1)) (reverse (ssnamex ss1)))
             ) ;_ mapcar
     (princ)
     ) ;_ defun
0 Likes
Message 3 of 5

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

I want to change Y scale factor of all blocks in my drawing...
....


Do you need a routine?  Unless you need to do it in multiple spaces, you can just use QSELECT to find all Blocks, and change the Y scale factor collectively for all of them in the Properties box.

Kent Cooper, AIA
Message 4 of 5

ВeekeeCZ
Consultant
Consultant

@Kent1Cooper wrote:

@Anonymous wrote:

I want to change Y scale factor of all blocks in my drawing...
....


Do you need a routine?  Unless you need to do it in multiple spaces, you can just use QSELECT to find all Blocks, and change the Y scale factor collectively for all of them in the Properties box.


...or batch using. But agree with Kent, it's 5 seconds job. You don't even need QSELECT, just Properties palette can filter out Block References.

 

 

Message 5 of 5

Anonymous
Not applicable
Accepted solution

absolutely perfect !!! thousand thank you for your help!

 

It was necessary that the treatment be automatic because it is automatically put symbols on points of a file export all the nights of another application.

 

Manually, it's fast, but I don't want to do it every night at midnight!

This function is perfect and I can call it with scr script will work alone!

Thanks again

Jérôme

0 Likes