• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Valued Contributor
    Posts: 85
    Registered: ‎01-08-2009
    Accepted Solution

    Change Dynamic Block Property "Scale Uniformly" Automatically

    529 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

    Please use plain text.
    Valued Mentor
    Posts: 889
    Registered: ‎08-08-2006

    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~~~
    Please use plain text.
    Valued Contributor
    msarqui
    Posts: 89
    Registered: ‎09-14-2010

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

    Please use plain text.
    *Expert Elite*
    Posts: 2,135
    Registered: ‎11-24-2009

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

     

     

    Please use plain text.
    Valued Contributor
    msarqui
    Posts: 89
    Registered: ‎09-14-2010

    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!

    Please use plain text.