CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products []
CZ | EN | DE
Login or
  Visitors: 3390

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    4968×  
Prices - CAD eShop:
applies to: AutoCAD · AutoCAD LT ·

See also:
Tip 12790:Centered dynamic label (e.g. area label).
Tip 12685:ReLinkField - re-link fields to source objects.
Tip 12616:Att2elev - move block to elevation specified by its attribute.
Tip 12271:Sheet set - how to add custom parameters, individual to each sheet?
Tip 12084:Three methods of adding line lengths in AutoCAD.

Back   All CAD Tips

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   

Increase your productivity with our set of BIM add-on functions for Autodesk Revit
CADstudio Revit Tools More info

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