Jump to content

Edit justification of attributes over multiple blocks


Recommended Posts

Posted

I was wondering if it's possible through LISP to do the following:

 

Issue:

I have a drawing with 400ish unique blocks with 5-6 attributes each.

The attributes have the same "tag-name" - so 400ish blocks with the following tags:

 

Pkt_nr

Label

LA-kode

Kote

Fnavn

Fkode

 

The blocks use a WIDE variety of text styles, text justification, height etc etc.

 

Is it possible through lisp to be able to edit ALL blocks and for instance change the text style, the justification, height to be the same.

 

I need the Pkt_nr tag to be one specific text style, with a specific justification/height ..... and another tag Fnavn to be yet another justification.

 

 

Hope it makes sense

 

example.jpg

 

Edited: I should probably have clarified, that I've only worked with AutoCAD for a few weeks, I'm used to drawing in Inventor, so my knowledge of AutoCAD is ... slim ... to say the least.

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • millehuse

    12

  • pBe

    7

  • ReMark

    4

  • CheSyn

    2

Top Posters In This Topic

Posted Images

Posted

That looks very promising, and it has the potential to be a huge help. I might not be using it the right way though, because I cant seem to find a way to edit all the blocks at one time.

 

I have to select an attribute, is there a way to select all attributes within different blocks, by typing the tag name?

 

Other than that, it seems to have all the things I desperately need. Text style, justification, height. Color is the only thing that is "missing" - but there are probably other lisps that can help me here.

 

One addon newb question, is there a way to make this changes "stick" .. so attsync wont reset the block so to speak?

Posted
Can you post a sample?

 

Not sure if you meant me, but I copied a few of the blocks into a new drawing, I dont know if that's what you meant by sample.

 

The thought of having to manually edit 400 blocks manually .. is giving me a slight headache =).

testblocks.dwg

Posted
Not sure if you meant me, but I copied a few of the blocks into a new drawing, I dont know if that's what you meant by sample.

 

The thought of having to manually edit 400 blocks manually .. is giving me a slight headache =).

 

Yes, that is what I meant. Unfortunately I only have AutoCAD 2011 so I am unable to open your drawing.

Posted

mille: Did you look at Lee Mac's lisp routine?

Posted

@CheSyn - ah okay, I can save it in a different format tomorrow when I'm back at work.

 

@ReMark - yeah I tried using the linked lisp routine - and as such it looks awesome. But I'm either using it incorrectly, or it doesnt quite do what I want. I can only get it to change 1 block at a time. And I cant make it "hard-save" the changes - cause when I attsync the drawing, the attributes go back to "normal". That wouldnt be a big issue, if I could change them all at one time, cause I only need to attsync when I xref in new blocks - which is 5-6 times a year.

 

Any tips?

Posted
@ReMark - yeah I tried using the linked lisp routine - and as such it looks awesome. But I'm either using it incorrectly, or it doesnt quite do what I want. I can only get it to change 1 block at a time. And I cant make it "hard-save" the changes - cause when I attsync the drawing, the attributes go back to "normal". That wouldnt be a big issue, if I could change them all at one time, cause I only need to attsync when I xref in new blocks - which is 5-6 times a year.

 

Any tips?

 

Thanks - glad you like the program.

 

The program is only performing attribute formatting overrides which, as you've gathered, are reversible using ATTSYNC.

 

For a global change, why not simply alter the formatting of the attribute definitions (ATTDEF objects) within the block definition, then use ATTSYNC to synchronise these changes across all references of the block.

Posted
Thanks - glad you like the program.

....

For a global change, why not simply alter the formatting of the attribute definitions (ATTDEF objects) within the block definition, then use ATTSYNC to synchronise these changes across all references of the block.

 

My knowledge of AutoCAD is VERY little, but I have come across ATTDEF, but the thought of redefining/updating 400 unique blocks - seems a bit much. I have yet to find a way to make this a simple task.

 

Regarding your program, is there a way to make it work on all 400 unique blocks at the same time, when the tag-name of the attributes are the same?

Posted
Yes, that is what I meant. Unfortunately I only have AutoCAD 2011 so I am unable to open your drawing.

 

Here is a sample in saved in 2010 version if that helps CheSyn

 

Still looking for a way to edit the attributes over multiple blocks if anyone has any tips.

 

Or if it cannot be done, then a confirmation of this would be very helpful as well. :)

sample2.dwg

Posted (edited)
For a global change, why not simply alter the formatting of the attribute definitions (ATTDEF objects) within the block definition, then use ATTSYNC to synchronise these changes across all references of the block.

 

I concur

 

My knowledge of AutoCAD is VERY little, but I have come across ATTDEF, but the thought of redefining/updating 400 unique blocks - seems a bit much. I have yet to find a way to make this a simple task.

 

It cannot be any simpler as what LM suggested. With the proper coding 400 unique block names wouldn't take that long.

 

Regarding your program, is there a way to make it work on all 400 unique blocks at the same time, when the tag-name of the attributes are the same?

 

Based on your sample drawing file. and as suggested by others, modify the block definition rather than iterating thru every block already existing on the drawing session. Doing it this way the changes are permanent and you will avoid messing the blocks whenever a user invoke the Attsync command even though its just " 5-6 times a year"

 

Humor us millehuse,

 

What exacty are the values for the following:

Text style

Justification

Height

Color

Edited by pBe
Posted

As stated in my original post, I havent worked with AutoCAD for very long and as such my knowledge is non-existant. So it might be, that I'm just misunderstanding the solution provided by LM.

 

Solution provided:

"alter the formatting of the attribute definitions" but in 400 unique blocks - wouldnt that require me opening all 400 different blocks to make the changes? If not, then this is where I'm confuzzled - and would need a little hint on how to achieve this.

 

My knowledge will humor you all day kind sir =P - my company has granted me 3 autocad courses next year, but I'd really like to get a head start on this one drawing.

 

The changes are very simple, and might seem humorous, but it's really just a matter of cleaning up the clutter on a drawing that has been 'violated' by autocad illiterates (like myself) for the last 5-6 years.

 

Text style = just make it the same in every block

Justification = need to make 1 attribute "button left" and another "top right" .. so that the text isnt on top of each other (right now all attributes are in the center of the blocks)

Height = same as text - it just needs to be the same all around

Color = need to change 1 attribute to white .. and have the block itself stay the color it is defined as.

 

English isnt my first language, so I might be explaining this all wrong.

Posted

400 unique blocks as in each and every block is different?

Posted
"alter the formatting of the attribute definitions" but in 400 unique blocks - wouldnt that require me opening all 400 different blocks to make the changes? If not, then this is where I'm confuzzled - and would need a little hint on how to achieve this.

 

NO. Automagically of course :)

 

Text style = just make it the same in every block

Justification = need to make 1 attribute "button left" and another "top right" .. so that the text isnt on top of each other (right now all attributes are in the center of the blocks)

Height = same as text - it just needs to be the same all around

Color = need to change 1 attribute to white .. and have the block itself stay the color it is defined as.

 

Ok then, I'll have a look-see tomorrow.

Posted
400 unique blocks as in each and every block is different?

 

Yup 400 different blocks - their attributes are defined with the same tag-names thought. If that makes it any difference or sense.

Posted
NO. Automagically of course :)

 

Ok then, I'll have a look-see tomorrow.

 

Automagically sounds awesome! Will look forward to your reply, thank you very much for your time.

Posted
After a quick look at your last posted drawing example I'd say you do NOT have 400 unique blocks. You may actually have, for example, 100 copies of 4 unique blocks. Would you agree?

 

That's 400 unique block names ReMark. probably from a third party software..

And check out the block names "11998-opm-20111013$0$BR4_14" my guess a product of XREF Bind ?

Posted

Certainly doesn't sound very efficient.

 

I don't know if I quite agree with your assessment that there are 400 individual blocks. In the Sample2-1.dwg there are several blocks all with the same block name (and in this case the same attribute value).

 

MultiBlock.jpg

Posted
Certainly doesn't sound very efficient.

 

I don't know if I quite agree with your assessment that there are 400 individual blocks. In the Sample2-1.dwg there are several blocks all with the same block name (and in this case the same attribute value).

 

[ATTACH=CONFIG]45731[/ATTACH]

 

Again my knowledge comes to short ... if I type BATTMAN I'm presented with a very very long list of block names ... and "found in drawing" states 1 with most of them. So I conclueded they were unique.

 

pBe is right on the money - the blocks are xreffed / bound into the drawing - and sent to us from an outside company - they will send updates 5-6 times a year.

 

As we have close to zero AutoCAD knowledge in the firm, I can guarantee it's very far from efficient. But it's a very important drawing and for future reference it would be nice to tidy it up.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...