Getting Started With Scripts

Some simple Python script examples:

  1. Display the Impact executable name and version—see Application object.

  2. See what type of drawing is currently active — see example for the drawing_type property.

  3. Display the attributes for each layer in the current drawing—inspect the ILayer object.

  4. Draw a line in the active block—use ActiveBlock.line_ad on the current drawing layer.

  5. Find a project in the database—use IDatabase.find_item_by_name.

  6. Create a new project, save it, and release it—work with the release_action property.

  7. 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.