Built-In Objects¶
When you run a script within Impact (Script Toolbox, a text entity, or an auto-task), several objects are pre-defined so you can use them immediately. In Python these appear as COM proxy instances; use the names as shown.
The impact object represents the Impact application. gui is pre-defined to impact.gui, and active_database resolves to impact.active_database. When a script runs in an nServer context, impact is not defined—use n_server instead.
Other pre-defined objects include active_drawing (normally impact.active_drawing), active_layer (normally impact.active_drawing.active_layer), and active_block (normally impact.active_drawing.active_layer.active_block). These are assigned at the start of script execution and are not updated if the script changes layers or opens a new drawing. During some operations (for example generating a border plot or editing a text entity), active_drawing and impact.active_drawing can intentionally refer to different drawings—the former is the original drawing, the latter is the temporary drawing used for output or preview.
List of built-in objects¶
impact(an IApplication object)gui(an IGUI object)active_block(an IActiveBlock object)active_layer(an ILayer object)active_drawing(an IDrawing object)active_database(an IDatabase object)globals(an IGlobals object)result(a variant value, often used inside text entities and value mappings)value(a variant value)n_server(an IServer object, available only in an nServer context)row_values(an IDatabaseValues object, used within data row report groups)row_block(an IBlock object, used within data row report groups)
These names are case-sensitive in Python.