AfraLISP - Learn AutoLISP for AutoCAD productivity

Viewing AutoCAD Objects

by Kenny Ramage

Visual Lisp has a great way of letting you view AutoCAD Objects by allowing you to "walk" through the drawing database. Let's have a wee look at what's on offer. Open AutoCAD with a blank drawing, and then open the Visual Lisp Editor. Let's set up what information we would like to see first :

From the Visual LISP editor pull-down menu, select ToolsEnvironment OptionsGeneral Options…

Click the "Diagnostic" tab in the "General Options" window.

Check "Inspect drawing objects verbosely", if not already checked, to view detailed entity information. Now click "OK".

Now select ViewBrowse Drawing DatabaseBrowse Tables

The "Drawing Tables" Inspection window will now open :

Drawing Tables

That's very nice!! We have a list of the symbol tables in our drawing. Now, double-click on <Layers> :

AutoCAD Layers

Even better! Now we've got a list of all the Layers in our drawing. Double-click on a layer name :

AutoCAD Table Entry

Crikey, now we've got a list of all the Layers attributes "including" the AutoLisp Entity list!

Now draw a line, a circle, and some text anywhere in your drawing and then select ViewBrowse Drawing DatabaseBrowse All Entities. The following Inspect window will open :

AutoCAD Entities

Now double-click on <MTEXT> :

ACAD MTEXT

Now we've got a list of all the text attributes.

Just one more so that you get the idea. This time choose ViewBrowse Drawing DatabaseBrowse Selection. The AutoCAD window will appear prompting you to select objects. Select all three objects :

Inspect: PICKSET

A list of all entities contained in your selection set will be displayed. This time double-click on the <LINE> object :

ACAD LINE

Again a list of the Objects attributes are displayed. Insert a few more Objects into your drawing such as blocks, blocks with attributes, polylines, hatches,etc. This set of tools gives you a good idea of how the AutoCAD Object Model is put together. Play around the them, you'll learn a lot…