Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change attribute width factor in several blocks

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Designer_1E
3976 Views, 7 Replies

Change attribute width factor in several blocks

Hello,

 

I've been searching all over for a LISP that can change the width factor of an attribute across dozens of blocks at a time?  The closest I have found is one that will change one attribute in one block at a time.  However i need to do hundreds.

 

We are forced to use blocks from a manufacturer that has an important attribute set at 0.5 width factor, and it is completely unreadable.  I have tried changing the overall text style, but it does nothing.  I can change them one at a time with BATTMAN, but like I said I need to do hundreds, repeatedly.

 

Please help.  Thanks.

7 REPLIES 7
Message 2 of 8
dlanorh
in reply to: Designer_1E

Change the width to what?

Do you want to change the block references or the block definitions and then attsync?

I am not one of the robots you're looking for

Message 3 of 8
dlanorh
in reply to: Designer_1E

Attached is a lisp file that combines two routines, either changing the Block Definitions and then attsyncing; or changing ALL attributed Block References in the drawing. Changing the References will omit any constant attributes as these are defined in the block definition, but this doesn't require an attsync. Block References on locked layers will not be honoured, i.e. they will be changed.

I am not one of the robots you're looking for

Message 4 of 8
Moshe-A
in reply to: Designer_1E

@Designer_1E  hi,

 


 I can change them one at a time with BATTMAN, but like I said I need to do hundreds, repeatedly.

Not true! if you use BATTMAN to set a new width to an attribute it will instantly change all the reference attributes in the current drawing (in all block references) this action is nearly the same if you edit the block with bedit and change an attribute width. why nearly? cause you also need to do attsync.

 

so if you did that and it did not reflect the attributes, then maybe you are missing the attribute or the attribute is in lock layer?

 

moshe

  

 

Message 5 of 8
jtoverka
in reply to: Designer_1E

What are your requirements? An accurate answer will determine the type and scope of program you need.

- Block definition?

- Block reference?

- All attributes in block or a specified list of attributes?

    - if a list, provide the list

- All blocks or a specified list of blocks?

    - if a list, provide the list

- Multiple drawings?

    - all drawings in a project or a list of drawings?

    - no need to provide list

- Multiple projects?

 

Here is a sample for a drawing wide program for all attribute references only. I doubt this will suit your needs, but it's a starting point

(progn
  (setq ent (entnext))
  (while ent
    (setq et (entget ent))
    (if (= "ATTRIB" (cdr (assoc 0 et)))
      (progn
        (entmod
          (subst
            '(41 . 1)
            (assoc 41 et)
            et
          )
        )
        (entupd ent)
      )
    )
    (setq ent (entnext ent))
  )
)
Message 6 of 8
Designer_1E
in reply to: dlanorh

This. is. amazing!  Thank you.

 

It was the definitions I really wanted, but it is great to have a choice!  You would not believe how many hours this will save me.

 

 

Message 7 of 8
Designer_1E
in reply to: Moshe-A

Hi Moshe,

 

BATTMAN does work.  It's just that I don't want to do it over, and over, and over again for each unique block.

Message 8 of 8
dlanorh
in reply to: Designer_1E

No problem. Attached is an updated version where "Definitions" is the default value when prompted for "Definitions" or "References".

 

I am not one of the robots you're looking for

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report