Layout Field
Function Syntax | lfname / lfnumber / lfsheet |
Current Version | 1.0 |
Download | LayoutFieldV1-0.lsp |
View HTML Version | LayoutFieldV1-0.html |
Donate |
Program Description
This program defines a set of commands which enable the user to populate a selected annotation object (Text, MText, Attribute) with a field expression referencing the name and position of the layout in which the object resides.
Contrary to the typical use of the CTAB system variable, as offered by the standard AutoCAD FIELD command, the field expressions generated by this program directly reference the ActiveX Layout object within the Layouts Collection, and therefore do not depend on the layout being current in order to display the correct output.
This is particularly advantageous when using the DATAEXTRACTION command to retrieve data from multi-layout drawings, as field expressions which reference the CTAB system variable will yield the same value for every layout when processed by this command.
Available Commands
The program as published offers three commands to enable the user to generate field expressions referencing various properties of the layout in which the selected annotation object resides, and properties of the drawing as a whole; each command is described in more detail below:
LFName
This command populates a selected annotation object (Text, MText, Attribute) with a field expression referencing the name of the layout which contains the selected annotation object.
LFNumber
This command populates a selected annotation object (Text, MText, Attribute) with a field expression referencing the position of the layout which contains the selected annotation object, relative to the first Paperspace layout in the drawing.
LFSheet
This command populates a selected annotation object (Text, MText, Attribute) with a field expression referencing the position of the layout containing the selected annotation object, relative to the first Paperspace layout in the drawing, and also includes the total number of Paperspace layouts in the drawing.
Custom Commands
The program is structured in such a way as to allow the user to refine the content generated by the existing commands to suit their requirements, or define additional commands to reference other layout properties as required.
Demonstration
Instructions for Running
Please refer to How to Run an AutoLISP Program.