Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

automatically fill in attributes from excel sourcefile

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
sieglinde.vanstraelen
6434 Views, 8 Replies

automatically fill in attributes from excel sourcefile

Hi all,

 

i am looking for a solution for the following:

 

i have an excel sourcefile, containing information about different buildings in columns (buildingnumber, buildingname, location (street, town etc)

i would like to be able to fill in one attribute (buildingnumber) and let the other attributes be filled in automatically from this sourcefile.

 

if someone can point me in the right direction, that would be greatly appreciated!

8 REPLIES 8
Message 2 of 9

Not going to be an out of the box solution.  You'll need to get into custom programming and database connectivity.  

 

 

fortunately, it's probably possible

Message 3 of 9

Please follow the steps below:

1. Ensure you have assigned different Building numbers into blocks in the drawing.

2. ATTOUT all attribute information to a txt file (File A).

3. In Excel,open File A and sort all contents by Building numbers.

4. In Excel open the excel source file (File B) and sort all contents by Building numbers as well.

5. Copy Related contents from File B to the File A, matching eaching columns, do not delete the HANDLE column.

6. Save File A.

7. Switch to dwg file, use command ATTIN to import the attribute information from File A.

Let me know if it works. I also wrote a routine many years ago befoer ATTOUT and ATTIN were avaiable to handle it but if above method works for you, we don't need that routine any more.

Message 4 of 9

Hi,

 

It works, but not exactly for the purpose i was hoping to use it.

 

here's the situation:

i use a block with all the building info on each layout page. Since 9/10 things i have to fill in are the same, and i have that information in a sourcefile i was hoping to subtrackt it, that i only had to fill in one attribute, and the rest would follow.

 

i tried your method, and it works on 1 block, but a copy of the block (on another layoutpage) has a different handle and cannot retrieve the information again from file 'A'. it seems as if i have to do this ATTOUT command again, to obtain the handle of the block before i can add it to the excellist and copy the information.

 

so maybe using a sourcefile isn't the best way to achieve this.

maybe (but i also have no idea how) it would be possible to create a set of user-defined parameters for the drawing (eg. parameter 'buildingnumber' and its value '412' which you would have to fill in once for the file) and then work with 'insert field' for the attributes of this block. if the parameters are made in the drawing template, and the the attributes can be linked to these parameters in the layouttemplate, this could maybe be a more efficient solution?

 

 

Message 5 of 9

No you don't need repeat the procedure for multiple layouts.

I have tried here and it works for all layouts.

Can you upload a simple example file and we can test on it?

 

Message 6 of 9

Hi,

 

It works if I delete the value of the colum 'Handle'.

if i save my txt file without anything in the handle collum and use the ATTIN command, i select the txt file, and then autocad prompts a window 'ATTIN -  Select blocks?'. if i press Yes, i can select the block i want to get filled in, and all the attributes that have a matching title in my file are filled in!

 

It even works immediately for another drawing, and i tested it on a block that has more attributes and some missing, here it fills in the attributes that it can recognise, and the rest is just blank. that works fine for me! (i am going to continue testing on some other files!)

 

thanks for all the help!

 

 

Message 7 of 9
shameem4u
in reply to: 3wood

Hallo,

 

I have the same situation, I have several layouts and I need to change Titile Block attribute value in all layouts. I change the values in txt file reload using ATTIN, but it changes only that particular layout that I have selected. Is there any way to apply that changes to all layouts.

 

Best Regards

Shameem

Message 8 of 9
paragmanju99
in reply to: shameem4u

hi there , there is a command GATTE which helps u to edit attribute in multiple layouts within a dwg file.. unfortunately it allows only one attribute at a time. or try using http://www.lee-mac.com/batte.html

 

 

Message 9 of 9
Anjali.shah2YMWX
in reply to: 3wood

Impressive solution 🙂

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

Post to forums  

Autodesk Design & Make Report

”Boost