By Dennis Collin
I frequently talk to AutoCAD users who want to make their drawings smarter and emulate BIM programs like Revit, or parametric modelling programs like Inventor. These programs have many included tools like ‘smart’ annotations where text entities are generated from component ‘meta data’. Vanilla AutoCAD tends to be used as a plain vanilla detailing application, but in fact by defining a library of block components with textural and numerical data, this information can be extracted and pushed to AutoCAD’s annotation tools automatically. This contrasts having to use various text tools and manually enter information individually, multiple times.
By using the Data Extraction Tool, Attribute, Dynamic Block Properties, layers and block names can be exported to an AutoCAD Table object or an Excel file. However, by leveraging AutoCAD’s programming environment, data can also be pushed to leader note annotations too! In many ways this process mimics Revit and Inventor’s automatic tagging capabilities.
The task is performed by a short and simple AutoLISP routine, create a new text file using Notepad or another similar App, and enter the following Lisp code as shown in the image below.
Save the file as BNamelabel.LSP. in a suitable resource folder.
Add the lisp routine to AutoCAD’s startup suite using the Appload command.
An overview of the APPLOAD function for AutoCAD/LT can be found here.
Once loaded, type in the command ‘BNameLabel’, select a block entity and then position the multileader annotation in a suitable location.
The routine uses the current multi-leader style and will adopt any defined settings including Annotative behaviour.
There is no link between the leader and the name of the block, should the block name change or be deleted the routine would need to be re-run to show the new information.
Lisp routines can be used for all kinds of tasks, saving users time and improving efficiency and productivity.
For some other examples of AutoLisp usage see some examples below.
Comentarios (0 comentarios)