Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

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

Change Dynamic Block Property "Scale Uniformly" Automatically

684 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
lpseifert
Posts: 889
Registered: ‎08-08-2006
Message 2 of 5 (671 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: 126
Registered: ‎09-14-2010
Message 3 of 5 (254 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*
pbejse
Posts: 2,406
Registered: ‎11-24-2009
Message 4 of 5 (248 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: 126
Registered: ‎09-14-2010
Message 5 of 5 (231 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
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

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

Ask the Community