A common requirement for drawing automation and for increase of the DWG "intelligence" is the automatic and dynamic (updating on changes) schedule of total line lengths or areas (acreage) listed by the individual layers.
Beside several solutions based on add-on LISP or ARX utilities, you can also solve this problem using the standard internal AutoCAD command DATAEXTRACTION - available already since version 2008.
The following images illustrate the workflow of selecting options in the drawing data extraction wizard and inserting the totals to an associative table in your drawing. Alternatively, you can export the data also to an external Excel table. Beside the described summary of line (polyline) lengths by layer, you can use similar approach also for any other object properties. You can also link the generated table with external sources (database, Excel) and extend it with lookup tables, price information, etc.
The settings specified in the wizard are stored in a DXE control file. On any change of the drawing contents (edit, adding new objects, etc.), the inserted table is updated (see the table's context menu, Update - and see the tip 8679).
The workflow (Czech version of AutoCAD 2013):
The initial state - lines in the individual layers (Beton, Chranicky, Kanalizace):
Run the extraction wizard from the ribbon:
Step 1: new or existing DXE file:
Step 2: selecting drawings and objects (all - use Settings to set more options):
Step 3: select the correct object types (here "Krivka" = Polyline) and name the columns of the future table:
Step 4: choose the displayed properties (here "Delka"=Length and "Hladina"=Layer) and name the columns:
Step 5: important - process the extracted data - either display individually or summarize them using the right-click menu option Combine Record Mode > Sum Values:
Step 6: output options - a drawing table or an external file:
Step 7: style of the schedule table:
Step 8: that's all
The resulting table ("Délky"=Lengths, "Hladina"="Layer):
Any change in the drawing or geometry will be now reflected to the table:
You can download this sample (including the DXE file) from the CAD blocks catalog.