Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
Posts: 86
Registered: ‎01-08-2009
Message 1 of 5 (644 Views)
Accepted Solution

Change Dynamic Block Property "Scale Uniformly" Automatically

644 Views, 4 Replies
12-16-2010 09:01 PM

G'day,

 

Been trying to figure out how to change the Scale Uniformly property in dynamic blocks accross hundreds of drawings using either/or scripts, lisp, vba or anything else that might do the job.

 

WIth my limited knowledge of programming im wondering if there is someone out there that may be able to help me out?

 

just need to open the drawing and select the block (one block per drawing) then edit the scale uniformly property within the block, save then close the drawing and move onto the next drawing.

 

Thank you in advance for your help with this matter.

 

Jason

Distinguished Mentor
Posts: 889
Registered: ‎08-08-2006
Message 2 of 5 (631 Views)

Re: Change Dynamic Block Property "Scale Uniformly" Automatically

12-17-2010 12:11 AM in reply to: jason.estas

see if this helps... no error control

 

(setq obj (vlax-ename->vla-object (car (entsel)))
      blknm (vlax-get obj 'Effectivename)
      )
(vlax-for blk (vla-get-blocks
                (vla-get-ActiveDocument
                  (vlax-get-acad-object)))
  (if (eq blknm (vla-get-Name blk))
    (vlax-put blk 'BlockScaling acUniform))
  )

 

 

~~~Civil 3D 2008~~~
Distinguished Contributor
msarqui
Posts: 114
Registered: ‎09-14-2010
Message 3 of 5 (214 Views)

Re: Change Dynamic Block Property "Scale Uniformly" Automatically

02-06-2013 04:24 PM in reply to: lpseifert

Hi,

 

Sorry for the question but: How I use it?

 

I tred this but I get an error when autocad starts...

 

(Defund c:BUS ()
(setq obj (vlax-ename->vla-object (car (entsel)))
blknm (vlax-get obj 'Effectivename)
)
(vlax-for blk (vla-get-blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)))
(if (eq blknm (vla-get-Name blk))
(vlax-put blk 'BlockScaling acUniform))
)
)

*Expert Elite*
Posts: 2,369
Registered: ‎11-24-2009
Message 4 of 5 (208 Views)

Re: Change Dynamic Block Property "Scale Uniformly" Automatically

02-06-2013 06:43 PM in reply to: msarqui

msarqui wrote:

Hi,

 

Sorry for the question but: How I use it?

 

I tred this but I get an error when autocad starts...

 

(Defund c:BUS ()
......


(Defun c:BUS ()
....)

 

 

Distinguished Contributor
msarqui
Posts: 114
Registered: ‎09-14-2010
Message 5 of 5 (191 Views)

Re: Change Dynamic Block Property "Scale Uniformly" Automatically

02-07-2013 10:14 AM in reply to: pbejse

hahaha. I guess I was tired...

 

Now it works fine but only one block at a time. I mean, it does not change automaticaly nested blocks. Also it does not accept "select all". I think I'll try to find another one :smileysad:

 

Thanks pbejse!

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community