AutoCAD 2004/2005/2006

AutoCAD 2004/2005/2006

Reply
Valued Contributor
mnovendstern
Posts: 68
Registered: ‎10-06-2003
Message 1 of 7 (669 Views)

Formulas in Attribute Values

669 Views, 6 Replies
05-13-2005 11:08 AM
Is it possible to have a predefined formula as an attribute value (part of the block definition) that would be calculated based on the value of other attributes in the same block. For example, user enters the area and a load factor as attributes and the occupancy attribute is calculated by dividing the area by the load. I thought I had it by checking the display value for block reference, but no luck.

See attached example.
Distinguished Contributor
spectrefish
Posts: 325
Registered: ‎03-29-2004
Message 2 of 7 (669 Views)

Re: Formulas in Attribute Values

05-13-2005 11:48 AM in reply to: mnovendstern
I know you can use formulas in a table but I don't think you can do it with attributes.
*Tim Decker
Message 3 of 7 (669 Views)

Re: Formulas in Attribute Values

05-13-2005 12:26 PM in reply to: mnovendstern
Instead of setting the OCCUPANTS expression value to point to the attribute
within the block directly, have it instead point to the block, and in the
list of block properties, you will see the tags for the blocks attributes
listed.

Let me do a step by step for you:

double-click on the block to enter the attribute editor, select the
occupants tag, right click on it's value entry, select insert field, choose
formula type, right click in the formula entry area, select insert field,
select object type, then click the button to select the block, in the list
of block properties, you will see that all of the attribute tags are listed,
select AREA and hit ok.

that value is now "dynamic", enter in your operator "/" and repeat the
above, except instead of area, select LOAD. When you OK out of the field
editor, and OK the attribute box, all should work well.

the reason that it did not work before, was that you wre telling it to use
the attribute definition values (pre-defined block, so only thing it could
see were the default values, and the defaults never change), not the
attribute value entries (only available after a block has been entered).

wrote in message news:4844684@discussion.autodesk.com...
Is it possible to have a predefined formula as an attribute value (part of
the block definition) that would be calculated based on the value of other
attributes in the same block. For example, user enters the area and a load
factor as attributes and the occupancy attribute is calculated by dividing
the area by the load. I thought I had it by checking the display value for
block reference, but no luck.

See attached example.
Valued Contributor
mnovendstern
Posts: 68
Registered: ‎10-06-2003
Message 4 of 7 (669 Views)

Re: Formulas in Attribute Values

05-13-2005 12:51 PM in reply to: mnovendstern
I have done this before and yes it works fine. The drawback is that the user needs to recreate the formula in the occupants attribute for each insertion of the block. I was trying to create a block with attributes that would have the formula predefined so that it would be a little more automated and less user error.

I thought that the display values for block reference would have solved this, guess not. Anyone know what that box actually does? It is only enabled when linking a field to an attribute.

AutoCAD's help says "Specifies that the object property fields in a block reference evaluate the properties of nested objects relative to the block reference's size and orientation within the drawing, not within the block definition."

Sounds like what I'm describing...but doesn't quite work like expected.
*Tim Decker
Message 5 of 7 (669 Views)

Re: Formulas in Attribute Values

05-13-2005 01:20 PM in reply to: mnovendstern
You are right, I was going to point out that you can't make a block for
"insert", but you can still copy/paste it, or copy it once inserted in a
drawing once you get the formula right.

wrote in message news:4844806@discussion.autodesk.com...
I have done this before and yes it works fine. The drawback is that the
user needs to recreate the formula in the occupants attribute for each
insertion of the block. I was trying to create a block with attributes that
would have the formula predefined so that it would be a little more
automated and less user error.

I thought that the display values for block reference would have solved
this, guess not. Anyone know what that box actually does? It is only
enabled when linking a field to an attribute.

AutoCAD's help says "Specifies that the object property fields in a block
reference evaluate the properties of nested objects relative to the block
reference's size and orientation within the drawing, not within the block
definition."

Sounds like what I'm describing...but doesn't quite work like expected.
*Tim Decker
Message 6 of 7 (669 Views)

Re: Formulas in Attribute Values

05-13-2005 01:33 PM in reply to: mnovendstern
You could always save it out as a nested block with the formula set, and
then upon isert just explode it, to reveal the editable block inside with a
preset formula.

"Tim Decker" wrote in message
news:4844841@discussion.autodesk.com...
You are right, I was going to point out that you can't make a block for
"insert", but you can still copy/paste it, or copy it once inserted in a
drawing once you get the formula right.

wrote in message news:4844806@discussion.autodesk.com...
I have done this before and yes it works fine. The drawback is that the
user needs to recreate the formula in the occupants attribute for each
insertion of the block. I was trying to create a block with attributes that
would have the formula predefined so that it would be a little more
automated and less user error.

I thought that the display values for block reference would have solved
this, guess not. Anyone know what that box actually does? It is only
enabled when linking a field to an attribute.

AutoCAD's help says "Specifies that the object property fields in a block
reference evaluate the properties of nested objects relative to the block
reference's size and orientation within the drawing, not within the block
definition."

Sounds like what I'm describing...but doesn't quite work like expected.
Valued Contributor
mnovendstern
Posts: 68
Registered: ‎10-06-2003
Message 7 of 7 (669 Views)

Re: Formulas in Attribute Values

05-13-2005 02:08 PM in reply to: mnovendstern
Thanks. It seems like a backwards way to do it, but it does work. It looks like AutoCAD is resolving the Object ID for the field when the block is exploded. Sure be nice if this wasn't necessary, but easy enough to workaround.
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.