CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
Cesky English Deutsch
 Visitors: 7679 

CAD tip CAD tip # 11160:

Question CAD 
 %  platform  category 
Q - question

Dynamic display of layer/block/text style/linetype properties.

A - answer The text field functionality in AutoCAD allows displaying dynamic properties - not only for drawing objects but also for named objects (internal DWG tables). Through this undocumented process you can display current properties of selected layers, text syles, linetypes, blocks, dimension styles, views and tables styles.

Use the standard dialog of the FIELD command or insert a field in your MText editor. Choose the category Objects > Named object. In the pane "Named object type", select the object type - e.g. Layer - and pick a specific object in the name list. In the bottom pane "Field expression", copy (Ctrl+C) the text between the "%" characters (including them). Cancel the dialog.

Edit the copied string (e.g. in Notepad) so that replace the trailing ".Name" with the name of the requested property - e.g. ".Color", ".Height" or ".FontFile".

Now paste this edited complete control string AcObjProp Object back again - as a plain string - into the MText editor or as a new DText - it will be replaced by the detected current value of the particular property. If you then change the property, the text will automatically reflect the change. You can also use more advanced processing using the fields with Diesel expressions.

A sample of such DWG file can be found in the Block Catalog - ObjFields.
100% *  CAD 
3.11.2016    2193×  
Comments   Tell a friend
applies to: AutoCAD · AutoCAD LT ·

See also:
Tip 11565:AttDefault - reset block attributes to default values.
Tip 11404:Operations with attributes inside a block - fields.
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

Be an expert in saving of drawings. « | » How to load an ECW v3 format image in AutoCAD?

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   

Link your AutoCAD texts with Excel tables/sheets. Export. Change. Import.
Try DwgText 2015 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.