PDA

View Full Version : Correctly calculating totals in a Table



.chad
2006-12-19, 02:51 PM
i have a series of fields set up to run parking counts for some schematic layouts. the parking rows have blocks with the parking count in them, which i have extracted to a table. if there arent repeating numbers in the table, everything works out fine in the lot summaries. if there are repeating elements, the table lists quanitites, and then the number of stalls (per the block). i am not sure how to have the fields multiply the number of blocks by the value of the block, then add up the whole total -

table
1 10
1 15
2 25

total should be 75, but ive only been able to get the field to display the sum of the block values (50) without the multiples registering twice.

thanks

Mike.Perry
2006-12-21, 08:37 AM
<SNIP>

table
1 10
1 15
2 25

total should be 75, but ive only been able to get the field to display the sum of the block values (50) without the multiples registering twice.Hi

Could you add another column to your Table eg


1 10 10
1 15 15
2 25 50
75If adding an additional column to your Table is not acceptable, you could look at setting up another Table ( as a workaround ) and link the two... David Cohn presents a very good class on this topic at AUGI CAD Camps.

If you need me to elaborate, explain further, could you please post an example DWG file ( containing the Block in question and a Table as you currently have it setup ).

Have a good one, Mike

.chad
2006-12-21, 02:18 PM
If you need me to elaborate, explain further, could you please post an example DWG file ( containing the Block in question and a Table as you currently have it setup ).
please do.

the table is just a basic table created from EatText. adding a column is fine, the table itself doesnt show up in any of the documents, just the final numbers.

Mike.Perry
2006-12-23, 07:33 AM
Hi

Take a look at the two options, attached. Please note the two options are far from finished pieces of work, but should offer yourself enough information to grasp the concepts and move forward with either option.

Option1: Additional column SubTotal added to Table. This option is the easiest to implement ( less work involved ), but has series limitation when "Attribute Extraction Table Needs Updating" is used.

Option2: Additional Table added and referenced ( linked ) to original Table. This option is via David Cohn's "Keep it inside AutoCAD - Data Extraction Direct to AutoCAD Tables" class ( taught at AUGI CAD Camps ). Option2 requires a little more work to setup compared to Option1 above, but removes some of the limitation associated with "Attribute Extraction Table Needs Updating".

With careful planning, Option2 offers a far more robust solution ( still not perfect due to limitations that exist with Tables Objects ), but definitely worth the extra setup time if "Attribute Extraction Table Needs Updating" is going to be used.

Have a good one, Mike

.chad
2006-12-26, 02:18 PM
Thank you :) i managed to work out the first solution through trial and error, but as you said, ran into issues when the attributes changed and needed to be updated.

davidmatyas
2007-01-03, 06:05 PM
Chad:

I realize that you resolved your table total problem, but would like to offer a suggestion. The only way I have come up with a resonable solution is to create (2) tables. Table 1 is the attribute extract from your parking symbols, the OTHER table references those values and has an additional column for the totals of each attribute value. That way when you update the extracted values table (table 1), the table of the referenced cells (table 2) reflect the same changes WITHOUT reformatting your table.

Appears to be twice the work but I DO get updated counts as attributed blocks are inserted and/or deleted.

Let me know if you need further clarification.

.chad
2007-01-03, 07:53 PM
thanks :mrgreen:

next time i have a parking layout ill give the two table method a shot. :beer:

Mike.Perry
2007-01-07, 01:14 AM
I realize that you resolved your table total problem, but would like to offer a suggestion. The only way I have come up with a resonable solution is to create (2) tables. Table 1 is the attribute extract from your parking symbols, the OTHER table references those values and has an additional column for the totals of each attribute value. That way when you update the extracted values table (table 1), the table of the referenced cells (table 2) reflect the same changes WITHOUT reformatting your table.

<SNIP>Hi

Have you reviewed Option 2 given above...

Have a good one, Mike

rb773
2007-03-23, 09:25 PM
Another answer and another question (I'm using Autocad 2007 with ADT) -

Answer -

You can also add columns in the eatext command for each block x and y insert location. This will force the table to list each item separately (As an added bonus, it will tell you if you have copies of blocks on top of each other so you do not accidently double count them. Just look in the quantities column for a number other than 1). Then you can just insert a field to total the column(s) you want. Use the "formula" and "sum" options in the field command and then select the table cells. After a table update, you will need to regen or save the drawing for the total field to update.

Question -

The above works great except when the number of blocks changes. For example, if you add or delete a block, you have to update the table. The field will only add up the cells it originally referenced, not any new ones. The same problem happens with the two table option. Anyone have a method of keeping accurate totals when the number of blocks changes?

noah
2007-08-24, 05:21 PM
I'm trying to do the same thing but with planting tags that total the number of plants from the tag symbols that have a planting key and a count. AA/25 (25 plants labeled AA).

I need to have the table add up all the AA counts and only list AA once with the totals. Essentially the same as the parking scenario but with two attributes (not just count).

Option 2 above doesn't work when adding blocks to the drawing. Is there a solution for this?

Thanks!