IGUI

class IGUI

Bases: ImpactCOMWrapperBase

Description:

Provides access to the graphical user interface.

Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance

property active_database_release

Gets active_database_release.

Description:

An IReleaseAction object that represents the active project being released.

Remarks:

When the Update (Before) and Update (After) auto-tasks are executed from within Impact this property can be used to determine details of the project being released. For example you can determine the release number of a project before and after an update.

Returns:

The value of active_database_release.

Return type:

active_database_release (IReleaseAction)

property active_database_revert

Gets active_database_revert.

Description:

An IRevertAction object that represents the active project revision being reverted or made current.

Remarks:

When the Revert (Before) and Revert (After) auto-tasks are executed from within Impact this property can be used to determine details of the project revision being reverted or made current. For example you can determine the revision number before and after a revert.

Returns:

The value of active_database_revert.

Return type:

active_database_revert (IRevertAction)

Examples:

property active_database_window

Gets active_database_window.

Description:

An IDatabaseWindow object that represents the active database window.

Remarks:

This object is only valid when the script is activated from a database window, for example from a DBW button.

Returns:

The value of active_database_window.

Return type:

active_database_window (IDatabaseWindow)

property active_window

Gets active_window.

Description:

The active drawing window.

Returns:

The value of active_window.

Return type:

active_window (IWindow)

property cursor

Gets Cursor.

Description:

May be used to change the display style of the mouse cursor.

Remarks:

Introduced in Impact 7.0.0.30.

Returns:

The value of Cursor.

Return type:

cursor (ipCursor)

Examples:

property output_toolbox

Gets output_toolbox.

Description:

Returns an IOutputToolBox object representing the output toolbox.

Returns:

The value of output_toolbox.

Return type:

output_toolbox (IOutputToolbox)

property picker

Gets Picker.

Description:

Returns an IPicker object to allow provide entity/point selection methods.

Returns:

The value of Picker.

Return type:

picker (IPicker)

property tools

Gets Tools.

Description:

Returns an ITools interface that can be used to perform various operations.

Returns:

The value of Tools.

Return type:

tools (ITools)

property windows

Gets Windows.

Description:

A collection of IWindow objects representing all the drawing windows open in the application.

Returns:

The value of Windows.

Return type:

windows (IWindows)

change_appearance(appearance)
Description:

Change the appearance of Impact by loading the toolbars and toolboxes from the appearance specified by name.

Remarks:

Deprecated, use change_appearance2 instead.

Parameters:

appearance (str) – Specifies the appearance to change to.

change_appearance2(appearance)
Description:

Change the appearance of Impact by loading the toolbars and toolboxes from the appearance specified.

Parameters:

appearance (IMasterSetting) – Specifies the appearance to change to.

Examples:

create_database_window_options()
Description:

Creates an IDatabaseWindowOptions object.

Remarks:

Introduced in Impact 11.0.0.27

create_dialog_picture_options()
Description:

Creates an IDialogPictureOptions object.

Remarks:

Introduced in Impact 11.0.0.11

create_file_open_dialog()
Description:

Creates an “open file” dialog, allowing the user to choose a file name and location.

Remarks:

Introduced in Impact 8.0.0.49

Examples:

create_file_save_dialog()
Description:

Creates an “save file” dialog, allowing the user to choose a file name and location.

Remarks:

Introduced in Impact 8.0.0.49

display_help_file(help_file_name)
Description:

Display the help file specified

Parameters:

help_file_name (str) – Full file path of the help file to display.

drag(pick_up_point, leave_original, scale, rotate, mirror_x, mirror_y, help_message)
Description:

Allows the user to drag (reposition) the selected entities. Similar to the Transform>Drag tool.

Remarks:

In the Transform>Drag tool, there is a Selection pull-down list; with COM, this defaults to the Select New behaviour.In the tool there is a Repeat From checkbox - this feature is not available from COM. You may prefer to use the Drag2 tool, which allows you to retrieve the picked position, plus the new entities.

Parameters:
  • pick_up_point (IVector) – Specifies the point around which selected entities are shifted.

  • leave_original (bool) – Specifies if the original entities should be deleted or not.

  • scale (float) – Specifies the scale of the shifted entities.

  • rotate (float) – Specifies the angle of rotation of the shifted entities.

  • mirror_x (bool) – Specifies if the shifted entities should be mirrored in the X direction or not.

  • mirror_y (bool) – Specifies if the shifted entities should be mirrored in the Y direction or not.

  • help_message (str) – Specifies the text that should be displayed in the status bar.

drag2(params)
Description:

Allows the user to drag (reposition) the selected entities. Similar to the Transform>Drag tool.

Remarks:

This method is very similar to Drag, but gives better feedback (via the Params object) about where the user picked, what options they used and which entities were created. Introduced in Impact 8.0.0.35

Returns:

Returns True if any entities were affected. Returns False if the user cancelled the pick operation or if there were no selected entities. (Note that prior to Impact 11.0.0.37, the method would return True if the user cancelled the pick.)

Parameters:

params (IDragParams) – Used to specify default options for the Drag tool, then retrieve information about what happened.

Examples:

isNone()

Checks if the COM object is None. This is useful for determining if the wrapper has been initialized with a valid COM object.

make_dialog(title)
Description:

Creates a dialog permitting user interaction.

Returns:

The method returns an IDialog object representing an “empty” dialog; use this object to add buttons and fields to the dialog then use the show_modal method to display the dialog.

Parameters:

title (str) – Specifies the title of the dialog.

open_browser_run_query(query)
Description:

Opens the Browser and runs the query specified by name on the active_database to locate one or more projects in the database

Remarks:

Deprecated, use open_browser_run_query2 instead.

Parameters:

query (str) – Specifies the query to run.

open_browser_run_query2(query_mts)
Description:

Opens the Browser and runs the query specified on the active_database to locate one or more projects in the database

Remarks:

Note that if the query has criteria, these cannot be specified programmatically. The “Enter Search Criteria” form will always prompt the user to enter the values.

Parameters:

query_mts (IMasterSetting) – Specifies the query to run.

Examples:

open_browser_run_query_sql(sql, exit_if_empty)
Description:

Opens the Browser and runs the supplied SQL query on the active_database to locate one or more projects in the database

Parameters:
  • sql (str) – Specifies the SQL used to locate projects

  • exit_if_empty (bool) – If the SQL query returns no matching projects then do not display the Browser

open_database_window(table_name, options)
Description:

Opens the configured database window for the specified table.

Remarks:

For DBW’s containing table list views the return value will signal if the user has added, changed or deleted any records in the DBW. Introduced in Impact 11.0.0.27

Returns:

Use the name “” to open the integrated database window (see linked example). Returns True if the user changed any values in the DBW.

Parameters:
  • table_name (str) – Table name, for example “ONE_UP”, or “”

  • options (IDatabaseWindowOptions) – Advanced options, optional.

Examples:

open_database_window2(database_window_mts, options)
Description:

Opens the database window for the specified DBW settings.

Remarks:

For DBW’s containing table list views the return value will signal if the user has added, changed or deleted any records in the DBW. Introduced in Impact 11.0.0.27

Returns:

Returns True if the user changed any values in the DBW.

Parameters:

Examples:

open_enterprise_project(code)
Description:

Opens the specified project on an Enterprise system, where the project may not exist on the local database. If the site database already contains the project and the user has it checked out then they will be prompted to open it. Otherwise the drawing information will be retrieved from the Enterprise and the normal Open dialog will be displayed.

Remarks:

Introduced in Impact 6.4.0.3 and 7.0.0.41.

Returns:

The drawing object.

Parameters:

code (str) – The drawing code (D_CODENUM).

Examples:

perform_value_mapping(value_mapping_name, drawing, layer)
Description:

Performs a value mapping by name.

Remarks:

Deprecated, use IGUI.perform_value_mapping2 instead.

Parameters:
  • value_mapping_name (str) – Specifies the value mapping to perform.

  • drawing (IDrawing) – Specifies the drawing on which to perform the value mapping.

  • layer (ILayer) – Specifies the layer on which to perform the value mapping.

perform_value_mapping2(value_mapping_mts, drawing, layer)
Description:

Performs a value mapping.

Remarks:

If you specify a Layer then the value mapping is performed only on that layer. If you do not specify a Layer then the value mapping is performed on the project and all appropriate layers within the project. You should not call this method from code within a database window (DBW) - please use perform_value_mapping_in_dbw for this purpose.

Parameters:
  • value_mapping_mts (IMasterSetting) – Specifies the value mapping to perform.

  • drawing (IDrawing) – Specifies the drawing on which to perform the value mapping.

  • layer (ILayer) – Specifies the layer on which to perform the value mapping.

Examples:

perform_value_mapping_in_dbw(value_mapping)
Description:

Perform a value mapping (similar to the perform_value_mapping2 method) from within a database window (DBW). You should only call this function when running a script inside a DBW from a button or callback.

Remarks:

Introduced in Impact 6.1.0.19.

Parameters:

value_mapping (IMasterSetting) – Specifies the value mapping to perform.

run_border_plot(border_plot_name)
Description:

Run the border plot specified by name on the currently active drawing.

Remarks:

Deprecated, use run_border_plot2 instead.

Parameters:

border_plot_name (str) – Specifies the border plot settings to use.

run_border_plot2(border_plot_mts)
Description:

Run the border plot specified on the currently active drawing.

Parameters:

border_plot_mts (IMasterSetting) – Specifies the border plot settings to use.

Examples:

run_report(report_name)
Description:

Run the report specified.

Parameters:

report_name (str) – The name of the report to run.

show_message(type, message, buttons)
Description:

Displays a simple message pop-up form.

Remarks:

Introduced in Impact 11.0.0.11

Returns:

The value for the button that the user pressed.

Parameters:

type (ipShowMessageType) – The type of message.

Message (‘str’): :param any buttons: An optional array of ipShowMessageButton values, specifying which buttons are to be displayed. Buttons can only be specified when Type is smtConfirmation.

Examples:

status_bar_message(message)
Description:

Displays a string on Impact’s status bar (at the bottom of the main window).

Remarks:

Introduced in Impact 8.0.0.33

Parameters:

message (str) – The string to display to the user.