CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 2959 

CAD tip CAD tip # 11404:

Question CAD 
 %  platform  category 
Q - question

Operations with attributes inside a block - fields.

A - answer If you want to perform an operation with attribute values directly inside a given block, you can define this operation either in the block definition or later in the block reference (insertion of the block instance).

You have e.g. a block with 3 attributes and you want the third attribute to contain a text string concatenated (merged) from the current values of the first two attributes. See an example in ConcatAtt.dwg - Block #15079.

To setup the requested operation in the block definition, set the third attribute's value from the fields referencing the objects (values) of the definitions of both source attributes (in Field: Object>Attribute Definition>Value and check Display value for block reference). To evaluate the attribute operation/fields after you insert the block or change its values, the block has to be dynamic - i.e. it must contain any dynamic action, e.g. a position, a visibility state, etc. plus you have to invoke this dynamic action at least once after you insert the block into your DWG drawing - e.g. drag the position node, change the visibility state. See the example, the block Concat (left).

For an operation defined in the block reference, you just use the attribute editor to set a field referencing the same object (the inserted reference) and the values of its first and second attributes. Such definition is evaluated automatically - i.e. e.g. on a regen. See the example, the block ConcatRef (right).

So after you change the value of the source attributes, perform the necessary update action and the block will reflect the changed value in the target attribute.

You can use a similar approach to link/mirror two attributes together - have two different attributes carrying the same value in a single block.

ACAD
100% *  CAD 
27.4.2017    1087×  
Comments   Tell a friend
applies to: AutoCAD ·

See also:
Tip 11439:Replace block instances (incl. dynamic) with another block.
Tip 11198:Justified attribute text in mirrored blocks (AutoCAD)
Tip 11171:Total number of layouts as a field.
Tip 10972:Replace text fields with static texts.
Tip 10889:How to get user's full domain name, phone No., department, e-mail...


Back   All CAD Tips All CAD tips&tricks

Catalog of all available hatch patterns. « | » Inventor reports an error: The referenced document cannot be resolved

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Use Google Earth images in your AutoCAD projects with the Plex.Earth Tools More info


Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist