Getting Started With Scripts

Some simple Python script examples:

  1. Display the Impact executable name and version — see example for the 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 — see example for the ILayer object.

  4. Draw a line in the active block—use — see example for the ActiveBlock.line_ad method.

  5. Find a project in the database — see example for the IDatabase.find_item_by_name method.

  6. Create a new project, save it, and release it — see example for the release_action property.

  7. Mimic the “Enquire > Palette & Symbol Usage” tool — see example for the IEnquireInsertions object.

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.