IPicker

class IPicker

Bases: ImpactCOMWrapperBase

Description:

Provides methods for picking entities and points.

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

property lock_mode

Gets lock_mode.

Description:

Gets and sets the lock mode used when selecting and picking entities.

Returns:

The value of lock_mode.

Return type:

lock_mode (ipLockMode)

property snap_mode

Gets snap_mode.

Description:

Gets and sets the snap mode used when selecting and picking entities.

Returns:

The value of snap_mode.

Return type:

snap_mode (ipSnapMode)

Examples:

get_entity(help_message, entire_drawing)
Description:

An interactive method to allow the user to pick an entity.

Remarks:

If the pick operation is cancelled this method returns null (Nothing).

Returns:

The picked entity is returned

Parameters:
  • help_message (str) – Specifies a message that is displayed on the Impact status bar.

  • entire_drawing (bool) – If True the entire drawing is considered, otherwise only the active block is considered.

Examples:

get_entity2(help_message, entire_drawing)
Description:

An interactive method to allow the user to pick an entity.

Remarks:

If the pick operation is cancelled this method returns null (Nothing). Introduced in Impact 8.0.0.77

Returns:

The returned IPickInfo object allows you to determine the picked entity, plus other information about the operation.

Parameters:
  • help_message (str) – Specifies a message that is displayed on the Impact status bar.

  • entire_drawing (bool) – If True the entire drawing is considered, otherwise only the active block is considered.

Examples:

get_entity_and_point(help_message, entire_drawing)
Description:

An interactive method to allow the user to pick an entity and determine the point near the entity that was picked. If the pick operation is cancelled this method returns null (Nothing).

Remarks:

The returned Point will be the exact position of the cursor, not necessarily exactly on the point. You can use the method get_nearest_along to find a suitable point on the entity. This method will ignore any snap mode (IPicker.snap_mode) that is active. The Side property of the returned IPickInfo object has no valid meaning.

Returns:

An IPickInfo object, which has properties Entity and Point.

Parameters:
  • help_message (str) – Specifies a message that is displayed on the Impact status bar.

  • entire_drawing (bool) – If True the entire drawing is considered, otherwise only the active block is considered.

Examples:

get_entity_and_side(help_message, entire_drawing)
Description:

An interactive method to allow the user to pick an entity and determine the side of the entity that was picked. If the pick operation is cancelled this method returns null (Nothing).

Remarks:

The ‘Point’ property of the returned IPickInfo object has no valid meaning.

Returns:

An IPickInfo object, which has properties Entity and Side.

Parameters:
  • help_message (str) – Specifies a message that is displayed on the Impact status bar.

  • entire_drawing (bool) – If True the entire drawing is considered, otherwise only the active block is considered.

Examples:

get_point(help_message)
Description:

An interactive method to allow the user to pick a point. If the pick operation is cancelled this method returns null (Nothing).

Parameters:

help_message (str) – Specifies a message that is displayed on the Impact status bar.

Examples:

get_point2(help_message)
Description:

An interactive method to allow the user to pick a point. If the pick operation is cancelled this method returns null (Nothing).

Returns:

An IPickInfo object, which has a property Point. This method is similar to get_point, but additionally you can detect if the user has pressed a key (such as Shift or Control) while picking. See IPickInfo.modifier. Introduced in Impact 8.0.0.54.

Parameters:

help_message (str) – Specifies a message that is displayed on the Impact status bar.

get_rubber_band_point(help_message, start_point)
Description:

An interactive method to allow the user to pick a point whilst a rubber band cursor is drawn from the previously picked point to the current cursor position. If the pick operation is cancelled this method returns null (Nothing).

Remarks:

Introduced in Impact 14.0.0.11.

Returns:

A IPickInfo object, which has a property Point.

Parameters:
  • help_message (str) – Specifies a message that is displayed on the Impact status bar.

  • start_point (IVector) – The user supplied location for the rubber band cursor anchor.

Examples:

get_selection(help_message, select_tool)
Description:

An interactive method to allow the user to select entities. If the pick operation is cancelled or no entities are selected this method returns an empty array.

Remarks:

This method uses the Select Box tool. If the user picks on individual entities, the method will continue until the user cancels it. If the user picks multiple entities using a rectangle, the method exits straight away. The user may press Control when picking an entity, to toggle the selection.

Returns:

An array of the selected entities. Note that the method returns all selected entities (same as IActiveBlock.selection), not just the entities selected during this operation.

Parameters:
  • help_message (str) – Specifies a message to be displayed on the Impact status bar.

  • select_tool (ipSelectTool) – Specifies the tool to use to select entities.

Examples:

Examples