Change attribute datatype for use in table formulae (AutoCAD LT 2019)

Change attribute datatype for use in table formulae (AutoCAD LT 2019)

Anonymous
Not applicable
1,194 Views
4 Replies
Message 1 of 5

Change attribute datatype for use in table formulae (AutoCAD LT 2019)

Anonymous
Not applicable

NOTE: Using AutoCAD LT 2019; don't have experience using Macros in AutoCAD

 

Aim:

to count/sum quantities of items (blocks) - plan to use sum/count table formulae for fields referencing these quantities

 

Approach:

defined attribute called 'BlkQty' for each block and defined count in them (AS NUMBERS, ex: 2, 5, etc.)

Inserted fields in a table referencing this 'BlkQty' attribute of various blocks in individual cells of a column. When I tried to use the sum or count table formula, the result still shows zero. 

 

Problem:

I think I am not getting the intended result of total block quantities because block attributes are viewed as text (? - I wasn't able to verify this anywhere though). I tried inserting plain numbers in another column of the same table and to my surprise I was able to use count/sum for those cells. Hence, I reached the conclusion that attributes might be viewed as text.

 

Is there any way I can defined a number in an attribute of a block and use the sum table formula on fields that reference these attributes?

0 Likes
Accepted solutions (1)
1,195 Views
4 Replies
Replies (4)
Message 2 of 5

CodeDing
Advisor
Advisor
Accepted solution

@Anonymous ,

 

If you are trying to place Attribute values into cells in a table as fields, then SUM those cells, you can do it this way...

For your blocks, create formulas of the Field Count * 1. Like this:

image.png

image.png

 

Then you can use the SUM formula as expected:

image.png

 

Final product:

image.png

Hope that helps!

Best,

~DD

Message 3 of 5

Anonymous
Not applicable

Thank you @CodeDing  - it seems silly to have asked this question now. I should have thought of this.

This simple fix works as intended!

Message 4 of 5

CodeDing
Advisor
Advisor

@Anonymous ,

 

Glad to help.

For your reference, all my method accomplishes is changing the Cell Data Type from "Text" to a "Whole Number".

If you can find a way to keep the cell in a "Whole Number" data type with only the field in it, then you will NOT need to use the formula (=x*1).

Bad for your use:

image.png

Good for your use:

image.png

Also, welcome to the forums! Come back whenever you need help.

 

Best,

~DD

0 Likes
Message 5 of 5

lena.talkhina
Alumni
Alumni

Welcome to the Autodesk Community @Anonymous !

Great  see you on LISP forum and that you already received the solution!  Thanks @CodeDing  for helping our new community members.

Check this link if you have any question about forums.

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian