PDA

View Full Version : Two-Way Linking of Attribute Data & Tables



stusic
2011-12-02, 05:27 PM
I've got a two-part problem I'm hoping some of the programming gurus can help me with. To begin, I'm trying to create a bill of materials that extracts data from attributed blocks and fills in corrsponding rows in a table. I've run into two problems I'm not sure how to approach.

The first is that I need to be able to edit the table and have those changes reflected in the block, but I also need to be able to edit the block attributes and have those changes reflected in the table. Using fields in the block accomplishes the first part, but not the other way around.

Secondly, I have multiple instances of these attributed blocks that are sequentially numbered. So when I insert the block and give it its number, it needs to go on a new line of the table. ITEM 1 attributes need to go on Row 1, ITEM 2 needs to go on Row 2, etc. But I don't assign the ITEM number until I insert the block.

For example, the block has these attributes:
ITEM NUMBER: Sequentially ordered from 1 to whatever.
PART NUMBER: A unique number identifying the exact model of valve, etc.

I want to be able to insert the block, then assign its ITEM NUMBER. I would start with 1, then the next block would be 2, etc. I'd like to be able to fill in the PART NUMBER for ITEM NO 1 in the attributed block, then Autocad fill in the table on the correct row.

I have no idea where to begin. I thought using fields would work, but it's not backwards compatible and I don't know how to link ITEM NUMBER 1 with Row 1.

Any help would be greatly appreciated, and a life preserver if I'm in over my head.

Thanks muchly!

elmoleaf
2011-12-05, 02:34 PM
Have you investigated ATTOUT and ATTIN? This will allow you to export/import your attributes to a txt file which can be opened/edited in Excel.
Insert all of your blocks and use a lisp program to click/number them automatically. Once you ATTOUT, you'll have a data set you can manipulate in Excel. After editing it in excel, you save again as a txt file which is imported via ATTIN to update the info in the block attributes in the drawing.

Not sure where you want the "table"....in autocad or elsewhere. If directly in autocad, I suppose you could skip attout/attin and schedule the attributed tags directly. However, I don't think a data extraction table like this allows you to edit the table to update the source block attributes.

You could use a Data Link to create an autocad table of the excel data within autocad.