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 (749 Views)
Accepted Solution

Change Dynamic Block Property "Scale Uniformly" Automatically

749 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

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))
)

 

 

Distinguished Mentor
lpseifert
Posts: 889
Registered: ‎08-08-2006
Message 2 of 5 (736 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: 135
Registered: ‎09-14-2010
Message 3 of 5 (319 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,500
Registered: ‎11-24-2009
Message 4 of 5 (313 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: 135
Registered: ‎09-14-2010
Message 5 of 5 (296 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!

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.