Getting Started With Scripts¶
Some simple Python script examples:
Display the Impact executable name and version—see Application object.
See what type of drawing is currently active — see example for the
drawing_typeproperty.Display the attributes for each layer in the current drawing—inspect the ILayer object.
Draw a line in the active block—use
ActiveBlock.line_adon the current drawing layer.Find a project in the database—use
IDatabase.find_item_by_name.Create a new project, save it, and release it—work with the
release_actionproperty.Mimic the “Enquire > Palette & Symbol Usage” tool—use IEnquireInsertions.
You can copy each of these examples into the Impact Script Toolbox (Window > Standard Toolboxes > Script Toolbox - make sure to select Language: Python) and press Run to execute the script.