IBlock¶
- class IBlock¶
Bases:
ImpactCOMWrapperBase- Description:
Represents a block object.
- Remarks:
Drawing operations cannot be performed on an IBlock object, use IActiveBlock instead.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property active¶
Gets Active.
- Description:
Indicates if this block is the active block.
- Remarks:
In order to make a block active, you must find a block insertion and use the IBlockInsert.activate method.
- Returns:
The value of Active.
- Return type:
active (bool)
- property block_type¶
Gets block_type.
- Description:
Describes the type of block.
- Returns:
The value of block_type.
- Return type:
- Examples:
- property description¶
Gets Description.
- Description:
Sets and gets the block description.
- Returns:
The value of Description.
- Return type:
description (str)
- property enquire_insertions¶
Gets enquire_insertions.
- Description:
Returns an IEnquireInsertions object that can be used to query the IBlock about the blocks and insertions within it.
- Remarks:
The block does not have to be active to use the IEnquireInsertions object. It should be noted that if you have made modifications to the current block, without saving them yet, then these modifications are not taken into account. Compare this with the similar recursed_entities property, which does include local changes.
- Returns:
The value of enquire_insertions.
- Return type:
- property enquire_lengths¶
Gets enquire_lengths.
- Description:
Returns an IEnquireLengths object that can be used to query the IBlock about the lengths and extents of the entities within it.
- Remarks:
The block does not have to be active in order to use the IEnquireLengths object.
- Returns:
The value of enquire_lengths.
- Return type:
- property entities¶
Gets Entities.
- Description:
Returns an IEntities collection representing all the entities in this block.
- property extents¶
Gets Extents.
- Description:
Gets the extents of all entities in this block.
- property full_name¶
Gets full_name.
- Description:
Sets and gets the block name.
- Returns:
The value of full_name.
- Return type:
full_name (str)
- Examples:
- property insertions¶
Gets Insertions.
- Description:
Returns an IBlockInserts collection representing all the insert entities in this block.
- Returns:
The value of Insertions.
- Return type:
- property layer¶
Gets Layer.
- Description:
The layer that this block belongs to.
- property recursed_entities¶
Gets recursed_entities.
- Description:
Returns an IRecursedEntities collection representing all the entities in this block and in all sub-blocks, along with their transformations.
- Remarks:
This method also recurses into layer insertions and symbol insertions, as well as block insertions. It should be noted that if you have made modifications to the current block, even if you have not saved them yet, they will be taken into account. Compare this with the similar enquire_insertions property, which does not include local changes. Introduced in Impact 8.0.0.65
- Returns:
The value of recursed_entities.
- Return type:
- Examples:
- property visible¶
Gets Visible.
- Description:
Sets and gets the visible state of the block/symbol.
- Remarks:
Note that this property applies to the current window (equivalent to active_drawing.active_window). Setting Visible to false hides all inserts of this block/symbol.
- Returns:
The value of Visible.
- Return type:
visible (bool)
- get_length_of_entities(recurse)¶
- Description:
Gets the total length of entities in this block.
- Remarks:
The block does not have to be active to use this method.
- Parameters:
recurse (bool) – If ‘Recurse’ is TRUE then any sub-blocks will also be used in the length calculation, otherwise they will be ignored.
- Examples:
- get_length_of_entities_by_palette(palettes, recurse)¶
- Description:
Gets the total length of entities in this block that have a specified palette.
- Remarks:
The block does not have to be active to use this method.
- Parameters:
palettes (any) – Specifies the palettes to get the lengths of. You can specify a palette name, a single IPalette object or an array of IPalette objects.
recurse (bool) – If ‘Recurse’ is TRUE then any sub-blocks will also be used in the length calculation, otherwise they will be ignored.
- Examples:
- get_palette_extents(palettes)¶
- Description:
Gets the extents of a list of palettes.
- Remarks:
The block does not have to be active to use this method.
- Parameters:
palettes (any) – Specifies the palettes to be used in the calculation of the extents. You can specify a palette name, a single IPalette object or an array of IPalette objects.
- Examples: