Creating Attribute Database in text file

Creating Attribute Database in text file

TP-WEI
Participant Participant
680 Views
3 Replies
Message 1 of 4

Creating Attribute Database in text file

TP-WEI
Participant
Participant

Greetings!

 

I am trying to create a database for structural header sizes. I have created a block with (2) attributes. One for the Header to be numbered, and the other for the header size. Once I insert all the header blocks needed I have been using "ATTOUT" to extract the attribute information into a .txt file. In that .txt. file I have a column for "Handle" (the random name that Autocad gives each block and what it uses to identify each block), "Block Name", "First Attribute", and "Second Attribute". In that text file I can adjust the header numbers and header sizes under thier respective columns. I then use "ATTIN" to adjust all the header block attributes according to the updated .txt. file. 

 

Here is the issue:

Once I use "ATTIN" and all the blocks are updated, Autocad modifies each block and assigns it a new handle (what once was "22c71" is now "22b65"). If for any reason I need to update the database and change either the header number or header size attributes a second time, I have to repeat the process all over again with the new handles for each block. If I try to just update the .txt database and re-run "ATTIN", it says that the block that has been updated cannot be found. Obviously because the Handle name has changed. I then have the option to either choose the block I want the change to apply to or quit  the command. This obviously doesn't help for multiple block attribute updates.

 

The solution I am pondering is if there is a way to create a .txt database that I can store my block attributes per drawing, update the attributes within the text file, and have that file always update the block attributes within the drawing without having to run attribute extraction every time. The end result I am trying to accomplish is a text file that will be linked to an excel file in which my engineers can manipulate the header sizes as needed, and I can use that file to update my header blocks automatically.

 

If I have not made myself clear or if there are any questions feel free to contact me!

 

AutoCAD 2016

 

Block Name: "HDR ATTT"

Attribute: Tag - HDR

                Prompt - Size?

                Default - (2)-2x 

Attribute: Tag - CALC

                Prompt - #?

                Default - X 

 

Thanks in advance CAD Warriors!! You guys rock!!!

 

Tony

"Cadmnky"

0 Likes
681 Views
3 Replies
Replies (3)
Message 2 of 4

Ajilal.Vijayan
Advisor
Advisor

Hi,

The block which you created is it a Normal block or Dynamic block ?

If Dynamic block, the block name will change when you use the dynamic functions.

This may cause the ATTIN to fail when you import the text file.

To my knowledge, in any case the Handles are persistent and it will not change even you reopen the drawing.

 

0 Likes
Message 3 of 4

TP-WEI
Participant
Participant

The only part of my block that is dynamic is a wipeout that sorrounds the text. I have Linear parameters with stretch actions so that I can adjust the wipeout to fit the text once the header size is changed. Do you think those parameters and actions are causing the Handle name to be changed upon using "ATTIN"? 

I just tried Saving and Closing my drawing, re-opening and then using "ATTIN", as well as using a block with absolutley no wipeouts at all, just attributes. Unfortunately I got the same results. Changed Handle names for each block after I use "ATTIN".

 

Thanks for your reply!!

 

Tony

0 Likes
Message 4 of 4

Ajilal.Vijayan
Advisor
Advisor

@TP-WEI wrote:

The only part of my block that is dynamic is a wipeout that sorrounds the text. I have Linear parameters with stretch actions so that I can adjust the wipeout to fit the text once the header size is changed. Do you think those parameters and actions are causing the Handle name to be changed upon using "ATTIN"?


No, the handle names will not change at any time.If you have a dynamic block inserted on your drawing and when you adjust the wipeout by using the strech action, AutoCAD will assign an annonymous name (*U8) to that block.And this may cause the ATTIN command to fail.
HANDLE    BLOCKNAME    TAG
'1F8           MyBlock           120
HANDLE    BLOCKNAME    TAG
'1F8          *U8                   120
As you can see in the both case the handle names didnt change.
0 Likes