IActiveBlock¶
- class IActiveBlock¶
Bases:
IBlock- Summary:
A special kind of IBlock object that allows geometry creation in block and world coordinates and manipulation of selected entities.
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.
- Summary:
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)
Examples:
- property auto_select¶
Gets auto_select.
- Summary:
If auto_select is TRUE then any geometry created will be automatically selected.
- Returns:
The value of auto_select.
- Return type:
auto_select (bool)
Examples:
- property block_type¶
Gets block_type.
- Summary:
Describes the type of block.
- Returns:
The value of block_type.
- Return type:
Examples:
- property description¶
Gets Description.
- Summary:
Sets and gets the block description.
- Returns:
The value of Description.
- Return type:
description (str)
Examples:
- property enquire_insertions¶
Gets enquire_insertions.
- Summary:
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.
- Summary:
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.
- Summary:
Returns an IEntities collection representing all the entities in this block.
Examples:
- property extents¶
Gets Extents.
- Summary:
Gets the extents of all entities in this block.
Examples:
- property full_name¶
Gets full_name.
- Summary:
Sets and gets the block name.
- Returns:
The value of full_name.
- Return type:
full_name (str)
Examples:
- property insertions¶
Gets Insertions.
- Summary:
Returns an IBlockInserts collection representing all the insert entities in this block.
- Returns:
The value of Insertions.
- Return type:
Examples:
- property layer¶
Gets Layer.
- Summary:
The layer that this block belongs to.
Examples:
- property origin¶
Gets Origin.
- Summary:
Gets and sets the origin of the active block.
- Remarks:
Reading this property will always return an IVector object with x and y coordinates equal to zero.
Examples:
- property recursed_entities¶
Gets recursed_entities.
- Summary:
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 selection¶
Gets Selection.
- Summary:
Represents all the selected entities within this block.
Examples:
- property visible¶
Gets Visible.
- Summary:
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)
Examples:
- arc(offset, radius, ccw, short)¶
- Summary:
Creates an IArc object using relative mode and vector parameters.
- Remarks:
If the radius is precisely half the length of an imaginary line between the last point and the new end point then the parameter “Small” makes no difference and a semicircular arc is drawn. If the arc’s radius is too small, so that it cannot fit between the start point and the expected end point, then a semicircular arc is drawn from the start point and terminating on an imaginary line drawn from the start point out to the expected end point, again the value of “Small” will make no difference.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
offset (IVector) – Offset to the end of the arc from the current position.
radius (float) – Specifies the radius of the arc.
ccw (bool) – Specifies if the arc should be counter clockwise or clockwise.
short (bool) – Specifies if the shortest or longest arc should be created.
Examples:
- arc_a(position, radius, ccw, short)¶
- Summary:
Creates an IArc object using absolute mode and vector parameters.
- Remarks:
If the radius is precisely half the length of an imaginary line between the last point and the new end point then the parameter “Small” makes no difference and a semicircular arc is drawn. If the arc’s radius is too small, so that it cannot fit between the start point and the expected end point, then a semicircular arc is drawn from the start point and terminating on an imaginary line drawn from the start point out to the expected end point, again the value of “Small” will make no difference.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
position (IVector) – Specifies the desired end point of the arc.
radius (float) – Specifies the radius of the arc.
ccw (bool) – Specifies if the arc should be counter clockwise or clockwise.
short (bool) – Specifies if the shortest or longest arc should be created.
Examples:
- arc_ad(x, y, radius, ccw, short)¶
- Summary:
Creates an IArc object using absolute mode and double parameters.
- Remarks:
If the radius is precisely half the length of an imaginary line between the last point and the new end point then the parameter “Small” makes no difference and a semicircular arc is drawn. If the arc’s radius is too small, so that it cannot fit between the start point and the expected end point, then a semicircular arc is drawn from the start point and terminating on an imaginary line drawn from the start point out to the expected end point, again the value of “Small” will make no difference.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
x (float) – Specifies the X coordinate of the desired end point of the arc.
y (float) – Specifies the Y coordinate of the desired end point of the arc.
radius (float) – Specifies the radius of the arc.
ccw (bool) – Specifies if the arc should be counter clockwise or clockwise.
short (bool) – Specifies if the shortest or longest arc should be created.
Examples:
- arc_three_points_a(mid_point, end_point)¶
- Summary:
Creates an IArc object using absolute mode and vector parameters.
- Remarks:
An arc is drawn starting from the last point, passing through the specified midpoint and ending at the specified endpoint.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
Examples:
- arc_three_points_ad(mid_point_x, mid_point_y, end_point_x, end_point_y)¶
- Summary:
Creates an IArc object using absolute mode and double parameters.
- Remarks:
An arc is drawn starting from the last point, passing through the specified midpoint and ending at the specified endpoint.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
mid_point_x (float) – Specifies the X coordinate of the midpoint of the arc.
mid_point_y (float) – Specifies the Y coordinate of the midpoint of the arc.
end_point_x (float) – Specifies the X coordinate of the endpoint of the arc.
end_point_y (float) – Specifies the Y coordinate of the endpoint of the arc.
Examples:
- arcd(x, y, radius, ccw, short)¶
- Summary:
Creates an IArc object using relative mode and double parameters.
- Remarks:
If the radius is precisely half the length of an imaginary line between the last point and the new end point then the parameter “Small” makes no difference and a semicircular arc is drawn. If the arc’s radius is too small, so that it cannot fit between the start point and the expected end point, then a semicircular arc is drawn from the start point and terminating on an imaginary line drawn from the start point out to the expected end point, again the value of “Small” will make no difference.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
x (float) – X offset to the end of the arc from the current position.
y (float) – Y offset to the end of the arc from the current position.
radius (float) – Specifies the radius of the arc.
ccw (bool) – Specifies if the arc should be counter clockwise or clockwise.
short (bool) – Specifies if the shortest or longest arc should be created.
Examples:
- arrange_after_entity(entity)¶
- Summary:
Reorders selected entities within the drawing data for the block after a specified entity.
- Remarks:
The ‘reference’ entity must be within the same block and must not be selected.
- Parameters:
entity (IEntity) – Specifies the entity which selected entities should be arranged after.
- arrange_before_entity(entity)¶
- Summary:
Reorders selected entities within the drawing data for the block before a specified entity.
- Remarks:
The ‘reference’ entity must be within the same block and must not be selected.
- Parameters:
entity (IEntity) – Specifies the entity which selected entities should be arranged before.
- arrange_optimal_path(position)¶
- Summary:
Reorders selected entities into an optimal order, starting approximately at a specified position.
- Remarks:
The sorted entities are moved to the end of the drawing data for block.
- Parameters:
position (IVector) – Specifies the position at which to begin optimising.
Examples:
- arrange_optimal_path2(position, entity)¶
- Summary:
Reorders selected entities into an optimal order, starting at the entity specified.
- Remarks:
The sorted entities are moved to the end of the drawing data for block.
- Parameters:
Examples:
- arrange_reverse()¶
- Summary:
Reorders selected entities within the block in reverse order to the end of the drawing data for the block.
- Remarks:
The direction of each of the selected entities is also reversed. If one or more block insertions are selected, the entities within the blocks are not affected.
- arrange_to_end()¶
- Summary:
Reorders selected entities within the block to the end of the drawing data for the block.
- arrange_to_start()¶
- Summary:
Reorders selected entities within the block to the start of the drawing data for the block.
- bezier_a(control1, control2, control3, control4)¶
- Summary:
Creates an IBezier object using absolute mode vector parameters.
- Returns:
If a valid bezier is created then an IBezier object is returned otherwise this method returns NULL.
- Parameters:
control1 (IVector) – A vector that specifies the first control point of the bezier.
control2 (IVector) – A vector that specifies the second control point of the bezier.
control3 (IVector) – A vector that specifies the third control point of the bezier.
control4 (IVector) – A vector that specifies the fourth control point of the bezier.
Examples:
- bezier_ad(x1, y1, x2, y2, x3, y3, x4, y4)¶
- Summary:
Creates an IBezier object using absolute mode and double parameters.
- Returns:
If a valid bezier is created then an IBezier object is returned otherwise this method returns NULL.
- Parameters:
x1 (float) – Specifies the X coordinate of the first control point of the bezier.
y1 (float) – Specifies the Y coordinate of the first control point of the bezier.
x2 (float) – Specifies the X coordinate of the second control point of the bezier.
y2 (float) – Specifies the Y coordinate of the second control point of the bezier.
x3 (float) – Specifies the X coordinate of the third control point of the bezier.
y3 (float) – Specifies the Y coordinate of the third control point of the bezier.
x4 (float) – Specifies the X coordinate of the fourth control point of the bezier.
y4 (float) – Specifies the Y coordinate of the fourth control point of the bezier.
Examples:
- block(name, description, position)¶
- Summary:
Creates a new block from the selected entities.
- Remarks:
This method creates the block and also creates an insert of this block.
- Returns:
An IBlockInsert object that is an insert of the newly created block.
- Parameters:
name (str) – The name of the new block. If a block with this name already exists a unique name will be generated from this name.
description (str) – The description of the new block.
position (ipBlockPosition) – The position of the new block.
Examples:
- block_insert(block, offset, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an IBlockInsert object using relative mode and vector parameters.
- Returns:
If a valid block insert is created then an IBlockInsert object is returned otherwise this method returns NULL.
- Parameters:
block (IBlock) – Specifies the block to make an insert of.
offset (IVector) – Specifies the offset to the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- block_insert_a(block, position, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an IBlockInsert object using absolute mode and vector parameters.
- Returns:
If a valid block insert is created then an IBlockInsert object is returned otherwise this method returns NULL.
- Parameters:
block (IBlock) – Specifies the block to make an insert of.
position (IVector) – Specifies the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- block_insert_ad(block, x, y, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an IBlockInsert object using absolute mode and double parameters.
- Returns:
If a valid block insert is created then an IBlockInsert object is returned otherwise this method returns NULL.
- Parameters:
block (IBlock) – Specifies the block to make an insert of.
x (float) – Specifies the X coordinate of the position of the insert.
y (float) – Specifies the Y coordinate of the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- block_insertd(block, x, y, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an IBlockInsert object using relative mode and double parameters.
- Returns:
If a valid block insert is created then an IBlockInsert object is returned otherwise this method returns NULL.
- Parameters:
block (IBlock) – Specifies the block to make an insert of.
x (float) – Specifies the X coordinate of the offset to the position of the insert.
y (float) – Specifies the Y coordinate of the offset to the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- change_palette_of_selected(palette, rebridge)¶
- Summary:
Changes the palette of selected entities.
- Remarks:
If the specified palette is not in the drawing that this block belongs to an error will occur.
- Parameters:
palette (IPalette) – Specifies the palette to change to.
rebridge (bool) – Specifies if the entities should be rebridged or not.
Examples:
- change_palette_of_selected2(palette, rebridge, deselect, recurse, clear_secondary_palettes)¶
- Summary:
Changes the palette of selected entities.
- Remarks:
If the specified palette is not in the drawing that this block belongs to an error will occur.
- Parameters:
palette (IPalette) – Specifies the palette to change to.
rebridge (bool) – Specifies if the entities should be rebridged or not.
deselect (bool) – Specifies if entities should be deselected or not.
recurse (bool) – Specifies if the operation should affect sub blocks or not.
clear_secondary_palettes (bool) – Specifies if the secondary palette should be cleared for any affected entities.
Examples:
- circle(offset, radius, start_angle, anti_clockwise)¶
- Summary:
Creates a circle and returns an IArc object representing the new circle, using relative mode and vector parameters.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
offset (IVector) – Specifies the offset to the centre of the circle.
radius (float) – Specifies the radius of the circle.
start_angle (float) – Specifies the start angle of the circle.
anti_clockwise (bool) – Determines wether the circle is drawn clockwise or anti-clockwise.
Examples:
- circle_a(centre, radius, start_angle, anti_clockwise)¶
- Summary:
Creates a circle and returns an IArc object representing the new circle, using absolute mode and vector parameters.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
centre (IVector) – Specifies the centre of the circle.
radius (float) – Specifies the radius of the circle.
start_angle (float) – Specifies the start angle of the circle.
anti_clockwise (bool) – Determines wether the circle is drawn clockwise or anti-clockwise.
Examples:
- circle_ad(x, y, radius, start_angle, anti_clockwise)¶
- Summary:
Creates a circle and returns an IArc object representing the new circle, using absolute mode and double parameters.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
x (float) – Specifies the X coordinate of the centre of the circle.
y (float) – Specifies the Y coordinate of the centre of the circle.
radius (float) – Specifies the radius of the circle.
start_angle (float) – Specifies the start angle of the circle.
anti_clockwise (bool) – Determines wether the circle is drawn clockwise or anti-clockwise.
Examples:
- circle_three_tangents(entity1, entity2, entity3, point_on_entity1, point_on_entity2, point_on_entity3, circle, tangent_for_entity1, tangent_for_entity2, tangent_for_entity3)¶
- Summary:
Creates a circle that is tangent to three entities. You need to specify a point on each of the entities - this is used to determine which of the multiple tangent points is required. Creates an arc or circle and returns an IArc object representing the new entity.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
entity1 (IEntity) – The first entity.
entity2 (IEntity) – The second entity.
entity3 (IEntity) – The third entity.
point_on_entity1 (IVector) – A point on the first entity.
point_on_entity2 (IVector) – A point on the second entity.
point_on_entity3 (IVector) – A point on the third entity.
circle (bool) – Specifies if a circle is created or not (otherwise it will be an arc).
tangent_for_entity1 (IVector) – Resulting tangent point on the first entity.
tangent_for_entity2 (IVector) – Resulting tangent point on the second entity.
tangent_for_entity3 (IVector) – Resulting tangent point on the third entity.
Examples:
- circled(x, y, radius, start_angle, anti_clockwise)¶
- Summary:
Creates a circle and returns an IArc object representing the new circle, using relative mode and double parameters.
- Returns:
If a valid arc is created then an IArc object is returned otherwise this method returns NULL.
- Parameters:
x (float) – Specifies the X coordinate of the offset to the centre of the circle.
y (float) – Specifies the Y coordinate of the offset to the centre of the circle.
radius (float) – Specifies the radius of the circle.
start_angle (float) – Specifies the start angle of the circle.
anti_clockwise (bool) – Determines wether the circle is drawn clockwise or anti-clockwise.
Examples:
- copy_entities(origin_x, origin_y, origin_mode, scale, angle, mirror_x, mirror_y, use_existing_blocks, entities)¶
- Summary:
Copies the specified entities to the active block
- Remarks:
The method parameter Scale must be greater than 0.
- Parameters:
origin_x (float) – Specifies the position of the origin in the X direction for the new entities.
origin_y (float) – Specifies the position of the origin in the Y direction for the new entities.
origin_mode (ipOriginMode) – Specifies how the origin is determined.
scale (float) – Specifies the scale of the new entities.
angle (float) – Specifies the angle of the new entities.
mirror_x (bool) – Specifies if a mirror should be applied in the X direction.
mirror_y (bool) – Specifies if a mirror should be applied in the Y direction.
use_existing_blocks (bool) – Specifies if existing blocks should be used.
entities (any) – Specifies the entities to copy.
Examples:
- copy_selected_to_layer(layer, leave_original)¶
- Summary:
Copies (or moves) the selected entities to another layer.
- Remarks:
The entities will be copied to the top-level of the chosen layer, not to it’s currently-active block. If the layer specified is the same as the layer to which this block belongs, an error will occur.
- Parameters:
layer (ILayer) – Specifies the target layer in which the entities will be copied (or moved).
leave_original (bool) – If leave_original is True, the original entities are left and copies created in the specified layer; if leave_original is False the selected entities are deleted from the source layer and copied to the specified target layer.
Examples:
- delete_selected()¶
- Summary:
Deletes all selected entities in the active block.
- Remarks:
This method will fail if the active block is a sub block and all entities are selected since it is not possible for an empty sub block to exist.
Examples:
- dimension_aligned(point1, point2, projection_length, projection_side, text_mode)¶
- Summary:
Creates an aligned linear dimension between two points.
- Remarks:
It is recommended that you use dimension_aligned2 instead of this method.
- Returns:
An ILinearDimension object representing the dimension created.
- Parameters:
point1 (IVector) – Specifies the first dimension point.
point2 (IVector) – Specifies the second dimension point.
projection_length (float) – Specifies the distance between the dimension points and the leader line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
Examples:
- dimension_aligned2(point1, point2, projection_length, projection_side, text_mode, dimension_options)¶
- Summary:
Creates an aligned linear dimension between two points.
- Remarks:
Introduced in Impact 10.0.0.70.
- Returns:
tagidentifier=##EXAMPLECODE,itemtype=Example%%%%comment%%” –>$$Example$$,format= %%%%filtereditemlist%%” –>$$See_Also$$%%designlist:tagidentifier=##SEEALSO,itemtype=See Also%%%%filtereditemlist%%” –>
- Return type:
An ILinearDimension object representing the dimension created. $$Remarks$$%%comment%%” –>$$Source_Code$$%%sourcecode%%” –>$$Example$$%%designlist
- Parameters:
point1 (IVector) – Specifies the first dimension point.
point2 (IVector) – Specifies the second dimension point.
projection_length (float) – Specifies the distance between the dimension points and the leader line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_angle(line1, line2, quadrant_point, text_mode)¶
- Summary:
Creates an angle dimension between two lines.
- Remarks:
It is recommended that you use dimension_angle2 instead of this method.
- Returns:
An IAngleDimension object representing the dimension created.
- Parameters:
line1 (ILine) – Specifies the first line.
line2 (ILine) – Specifies the second line.
quadrant_point (IVector) – Defines where the dimension entity is placed.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
Examples:
- dimension_angle2(line1, line2, quadrant_point, text_mode, dimension_options)¶
- Summary:
Creates an angle dimension between two lines.
- Remarks:
Introduced in Impact 10.0.0.70.
- Returns:
tagidentifier=##EXAMPLECODE,itemtype=Example%%%%comment%%” –>$$Example$$,format= %%%%filtereditemlist%%” –>$$See_Also$$%%designlist:tagidentifier=##SEEALSO,itemtype=See Also%%%%filtereditemlist%%” –>
- Return type:
An IAngleDimension object representing the dimension created. $$Remarks$$%%comment%%” –>$$Source_Code$$%%sourcecode%%” –>$$Example$$%%designlist
- Parameters:
line1 (ILine) – Specifies the first line.
line2 (ILine) – Specifies the second line.
quadrant_point (IVector) – Defines where the dimension entity is placed.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_automatic(place_overall_dimensions, place_main_dimensions, vertical_position, horizontal_position)¶
- Summary:
Automatically dimensions the selected entities.
- Remarks:
It is recommended that you use dimension_automatic2 instead of this method.
- Parameters:
place_overall_dimensions (bool) – Place horizontal and vertical dimensions indicating the extents of the design.
place_main_dimensions (bool) – Place dimensions (horizontal and vertical only) across the main panels.
vertical_position (ipAutoDimensionPosition) – Specifies the position of vertical dimensions.
horizontal_position (ipAutoDimensionPosition) – Specifies the position of horizontal dimensions.
Examples:
- dimension_automatic2(place_overall_dimensions, place_main_dimensions, vertical_position, horizontal_position, dimension_options)¶
- Summary:
Automatically dimensions the selected entities. $$Syntax$$%%Syntax%%” –>
- Remarks:
Introduced in Impact 10.0.0.70.
- Parameters:
place_overall_dimensions (bool) – Place horizontal and vertical dimensions indicating the extents of the design.
place_main_dimensions (bool) – Place dimensions (horizontal and vertical only) across the main panels.
vertical_position (ipAutoDimensionPosition) – Specifies the position of vertical dimensions.
horizontal_position (ipAutoDimensionPosition) – Specifies the position of horizontal dimensions.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_between_points(point1, point2, offset, projection_length, projection_side, mode)¶
- Summary:
Creates vertical or horizontal dimensions between two arbitrary points.
- Remarks:
The Point1 and Point2 vectors must be aligned vertically or horizontally, otherwise an error will occur. The “intersection line” is the imaginary line from Point1 to Point2. Only lines which are perpendicular to the intersection line are used; any others are ignored. Remember arrays are zero based and collections are one based. It is recommended that you use dimension_between_points2 instead of this method.
- Returns:
An array of ILinearDimension objects representing all the dimension entities created.
- Parameters:
point1 (IVector) – The first point.
point2 (IVector) – The second point.
offset (float) – The distance to offset the actual dimensions from the intersection line.
projection_length (float) – The distance from the first dimension point to the dimension line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
mode (ipDimensionMode) – Specifies how multiple dimension points (more than two) should be converted into dimensions.
Examples:
- dimension_between_points2(point1, point2, offset, projection_length, projection_side, mode, dimension_options)¶
- Summary:
Creates vertical or horizontal dimensions between two arbitrary points. $$Syntax$$%%Syntax%%” –>
- Remarks:
The Point1 and Point2 vectors must be aligned vertically or horizontally, otherwise an error will occur. The “intersection line” is the imaginary line from Point1 to Point2. Only lines which are perpendicular to the intersection line are used; any others are ignored. Remember arrays are zero based and collections are one based. Introduced in Impact 10.0.0.70.
- Returns:
An array of ILinearDimension objects representing all the dimension entities created.
- Parameters:
point1 (IVector) – The first point.
point2 (IVector) – The second point.
offset (float) – The distance to offset the actual dimensions from the intersection line.
projection_length (float) – The distance from the first dimension point to the dimension line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
mode (ipDimensionMode) – Specifies how multiple dimension points (more than two) should be converted into dimensions.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_horizontal(points, projection_length, projection_side, mode)¶
- Summary:
Creates one or more horizontal dimensions.
- Remarks:
Remember arrays are zero based and collections are one based. It is recommended that you use dimension_horizontal2 instead of this method.
- Returns:
An array of ILinearDimension objects representing all the dimensions created.
- Parameters:
points (any) – An array of vectors specifying the points that should be dimensioned.
projection_length (float) – The distance from the first dimension point to the dimension line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
mode (ipDimensionMode) – Specifies how multiple dimension points (more than two) should be converted into dimensions.
Examples:
- dimension_horizontal2(points, projection_length, projection_side, mode, dimension_options)¶
- Summary:
Creates one or more horizontal dimensions. $$Syntax$$%%Syntax%%” –>
- Remarks:
Introduced in Impact 10.0.0.70.
- Returns:
Remember arrays are zero based and collections are one based. An array of ILinearDimension objects representing all the dimensions created. $$Remarks$$%%comment%%” –>
- Parameters:
points (any) – An array of vectors specifying the points that should be dimensioned.
projection_length (float) – The distance from the first dimension point to the dimension line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
mode (ipDimensionMode) – Specifies how multiple dimension points (more than two) should be converted into dimensions.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_radius(arc, point_on_arc, text_mode)¶
- Summary:
Creates a radius dimension for a given arc.
- Remarks:
It is recommended that you use dimension_radius2 instead of this method.
- Returns:
An IRadiusDimension object representing the dimension created.
- Parameters:
arc (IArc) – The arc to be dimensioned.
point_on_arc (IVector) – Specifies the position of the dimension.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
Examples:
- dimension_radius2(arc, point_on_arc, text_mode, dimension_options)¶
- Summary:
Creates a radius dimension for a given arc. $$Syntax$$%%Syntax%%” –>
- Remarks:
Introduced in Impact 10.0.0.70.
- Returns:
tagidentifier=##EXAMPLECODE,itemtype=Example%%%%comment%%” –>$$Example$$,format= %%%%filtereditemlist%%” –>$$See_Also$$%%designlist:tagidentifier=##SEEALSO,itemtype=See Also%%%%filtereditemlist%%” –>
- Return type:
An IRadiusDimension object representing the dimension created. $$Remarks$$%%comment%%” –>$$Source_Code$$%%sourcecode%%” –>$$Example$$%%designlist
- Parameters:
arc (IArc) – The arc to be dimensioned.
point_on_arc (IVector) – Specifies the position of the dimension.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_sweep(arc, point_on_arc, projection_length, text_mode, dimension_options)¶
- Summary:
Creates a sweep dimension for a given arc, showing the arc length.
- Remarks:
Introduced in Impact 11.0.0.44.
- Returns:
An ISweepDimension object representing the dimension created.
- Parameters:
arc (IArc) – The arc to be dimensioned.
point_on_arc (IVector) – Specifies the position of the dimension.
projection_length (float) – The distance of the dimension from the arc.
text_mode (ipDimensionTextMode) – Specifies the placement of the dimension text.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- dimension_vertical(points, projection_length, projection_side, mode)¶
- Summary:
Creates one or more vertical dimensions.
- Remarks:
Remember arrays are zero based and collections are one based. It is recommended that you use dimension_vertical2 instead of this method.
- Returns:
An array of ILinearDimension objects representing all the dimensions created.
- Parameters:
points (any) – An array of vectors specifying the points that should be dimensioned.
projection_length (float) – The distance from the first dimension point to the dimension line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
mode (ipDimensionMode) – Specifies how multiple dimension points (more than two) should be converted into dimensions.
Examples:
- dimension_vertical2(points, projection_length, projection_side, mode, dimension_options)¶
- Summary:
Creates one or more vertical dimensions. $$Syntax$$%%Syntax%%” –>
- Remarks:
Remember arrays are zero based and collections are one based. Introduced in Impact 10.0.0.70.
- Returns:
An array of ILinearDimension objects representing all the dimensions created. $$Remarks$$%%comment%%” –>
- Parameters:
points (any) – An array of vectors specifying the points that should be dimensioned.
projection_length (float) – The distance from the first dimension point to the dimension line.
projection_side (ipProjectionSide) – The side on which the dimension line will be positioned relative to the first two dimension points.
mode (ipDimensionMode) – Specifies how multiple dimension points (more than two) should be converted into dimensions.
dimension_options (IDimensionOptions) – An IDimensionOptions object which specifies the settings to be used for the dimension entities.
- explode(options)¶
- Summary:
Explodes the selected entities, using the provided options.
- Remarks:
Remember arrays are zero based and collections are one based.
- Returns:
An array of IEntity objects created as a result of exploding selected entities.
- Parameters:
options (IExplodeOptions) – Specifies the entities to explode and how they should be exploded.
Examples:
- fillet(entity1, entity2, point1, point2, radius)¶
- Summary:
A fillet is created between two entities.
- Remarks:
A point on each entity is used to determine the solution. If either of the entities to be filleted end up with zero length then its corresponding handle will be uninitialised and removed from the drawing. The result of this method may be NULL if no solution was found. If any other the IEntity objects or IVector objects passed to this method or not valid an error will occur.
- Returns:
If a solution was found this method returns the IArc object created by this method, otherwise it returns NULL.
- Parameters:
Examples:
- get_area_and_length_of_selected(outer_area, inner_area, outer_perimeter, inner_perimeter, recurse)¶
- Summary:
Gets the area and perimeter lengths of selected entities.
- Parameters:
outer_area (any) – The outer area is returned in this parameter.
inner_area (any) – The inner area is returned in this parameter.
outer_perimeter (any) – The outer perimeter is returned in this parameter.
inner_perimeter (any) – The inner perimeter is returned in this parameter.
recurse (bool) – If Recurse is TRUE then the calculation will recurse into and include entities in sub blocks.
Examples:
- get_entity_extents_in_box(box)¶
- Summary:
Gets the extents of all entities partially or wholly enclosed by the specified rectangular area.
- Remarks:
Introduced in Impact 12.0.0.185
- Parameters:
box (IRect) – Specifies the rectangular area partially enclosing the entities.
Examples:
- get_length_of_entities(recurse)¶
- Summary:
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)¶
- Summary:
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)¶
- Summary:
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:
- get_selected_extents()¶
- Summary:
Gets the extents of all selected entities.
Examples:
- get_visible_extents()¶
- Summary:
Gets the extents of all visible entities.
Examples:
- graphic(origin, width, height, options)¶
- Summary:
Creates an IGraphic object using relative mode and vector parameters.
- Parameters:
origin (IVector) – Specifies the origin of the graphic entity.
width (float) – Specifies the width of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
height (float) – Specifies the height of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
options (IGraphicOptions) – Specifies the options to use to create the graphic entity.
Examples:
- graphic_a(origin, width, height, options)¶
- Summary:
Creates an IGraphic object using absolute mode and vector parameters.
- Parameters:
origin (IVector) – Specifies the origin of the graphic entity.
width (float) – Specifies the width of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
height (float) – Specifies the height of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
options (IGraphicOptions) – Specifies the options to use to create the graphic entity.
Examples:
- graphic_ad(x, y, width, height, options)¶
- Summary:
Creates an IGraphic object using absolute mode and double parameters.
- Parameters:
x (float) – Specifies the origin of the graphic entity in the X direction.
y (float) – Specifies the origin of the graphic entity in the Y direction.
width (float) – Specifies the width of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
height (float) – Specifies the height of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
options (IGraphicOptions) – Specifies the options to use to create the graphic entity.
Examples:
- graphicd(x, y, width, height, options)¶
- Summary:
Creates an IGraphic object using relative mode and double parameters.
- Parameters:
x (float) – Specifies the origin of the graphic entity in the X direction.
y (float) – Specifies the origin of the graphic entity in the Y direction.
width (float) – Specifies the width of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
height (float) – Specifies the height of the entity, only applicable if the graphic_fill property of the options is gfUserDefined.
options (IGraphicOptions) – Specifies the options to use to create the graphic entity.
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.
- layer_insert(layer, offset, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an ILayerlInsert object using relative mode and vector parameters.
- Remarks:
An error will occur if you attempt to create a layer insert in a sub-block or insert a layer into itself.
- Returns:
If a valid layer insert is created then an ILayerInsert object is returned otherwise this method returns NULL.
- Parameters:
layer (ILayer) – Specifies the layer to make an insert of.
offset (IVector) – Specifies the offset to the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- layer_insert_a(layer, position, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an ILayerlInsert object using absolute mode and vector parameters.
- Remarks:
An error will occur if you attempt to create a layer insert in a sub-block or insert a layer into itself.
- Returns:
If a valid layer insert is created then an ILayerInsert object is returned otherwise this method returns NULL.
- Parameters:
layer (ILayer) – Specifies the layer to make an insert of.
position (IVector) – Specifies the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- layer_insert_ad(layer, x, y, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an ILayerlInsert object using absolute mode and double parameters.
- Remarks:
An error will occur if you attempt to create a layer insert in a sub-block or insert a layer into itself.
- Returns:
If a valid layer insert is created then an ILayerInsert object is returned otherwise this method returns NULL.
- Parameters:
layer (ILayer) – Specifies the layer to make an insert of.
x (float) – Specifies the X coordinate of the position of the insert.
y (float) – Specifies the Y coordinate of the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- layer_insertd(layer, x, y, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an ILayerlInsert object using relative mode and double parameters.
- Remarks:
An error will occur if you attempt to create a layer insert in a sub-block or insert a layer into itself.
- Returns:
If a valid layer insert is created then an ILayerInsert object is returned otherwise this method returns NULL.
- Parameters:
layer (ILayer) – Specifies the layer to make an insert of.
x (float) – Specifies the X coordinate of the offset to the position of the insert.
y (float) – Specifies the Y coordinate of the offset to the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- line(offset)¶
- Summary:
Creates an ILine object using relative mode and vector parameters.
- Remarks:
If the offset is a zero vector then this function will fail.
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
offset (IVector) – Specifies the end point of the line calculated by the current position offset by this parameter.
Examples:
- line_a(position)¶
- Summary:
Creates an ILine object using absolute mode and vector parameters.
- Remarks:
If the vector “Position” is equal to the start point then this function will fail.
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
position (IVector) – Specifies the absolute end point of the line.
Examples:
- line_ad(x, y)¶
- Summary:
Creates an ILine object using absolute mode and double parameters.
- Remarks:
If the vector specified by the parameters X and Y is equal to the start point then this function will fail.
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
x (float) – Specifies the absolute X coordinate of the end point of the line.
y (float) – Specifies the absolute Y coordinate of the end point of the line.
Examples:
- line_point_tangent(from, arc, near)¶
- Summary:
Creates an ILine object using absolute mode.
- Remarks:
A line is drawn from the the point specified by “From” to a tangent point on the arc specified by “Arc”; which tangent is defined by the third parameter, “Near”, which is a point that is near to the required tangent point.The last point used will be the end of the drawn line, i.e. the tangent point.
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
Examples:
- line_tan_tan(arc1, arc2, near1, near2)¶
- Summary:
Creates an ILine object tangent to two arcs, using absolute mode.
- Remarks:
A line is drawn such that it is tangent to the two arcs passed in as parameters. The points passed to the function define which tangent points are to be used.The last point used will be the end of the drawn line
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
Examples:
- line_tangent_point(arc, near, to)¶
- Summary:
Creates an ILine object using absolute mode.
- Remarks:
A line is drawn from a tangent point on the arc specified by “Arc”; which tangent is defined by the second parameter, “Near”, that is a point which is near to the required tangent point The end of the line is given by the parameter “To”.The last point used will be the end of the drawn line, i.e. “To”.
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
Examples:
- lined(x, y)¶
- Summary:
Creates an ILine object using relative mode and double parameters.
- Remarks:
If the offset vector specified by the parameters X and Y is a zero vector then this function will fail.
- Returns:
If a valid line is created then an ILine object is returned otherwise this method returns NULL.
- Parameters:
x (float) – Specifies the X coordinate of the end point of the line calculated by the current position offset by this parameter.
y (float) – Specifies the Y coordinate of the end point of the line calculated by the current position offset by this parameter.
Examples:
- mirror(axis_start, axis_end, retain)¶
- Summary:
Mirrors selected entities about a specific axis.
- Remarks:
Remember arrays are zero based and collections are one based.
- Returns:
An array of IEntity objects created if any entities were created by this operation.
- Parameters:
axis_start (IVector) – Specifies the start point of the axis about which to mirror entities.
axis_end (IVector) – Specifies the end point of the axis about which to mirror entities.
retain (bool) – If Retain is TRUE then the original entities will be left in place and copies will be placed in the mirrored positions. If Retain is FALSE then the entities will be moved to the mirrored positions.
Examples:
- move(offset)¶
- Summary:
Moves the current position using relative mode and vector parameters.
- Parameters:
offset (IVector) – Specifies the offset to the new position.
Examples:
- move_a(position)¶
- Summary:
Moves the current position using absolute mode and vector parameters.
- Parameters:
position (IVector) – Specifies point to move to.
Examples:
- move_ad(x, y)¶
- Summary:
Moves the current position using absolute mode and double parameters.
- Parameters:
x (float) – Specifies the X coordinate of the point to move to.
y (float) – Specifies the Y coordinate of the point to move to.
Examples:
- moved(x, y)¶
- Summary:
Moves the current position using relative mode and double parameters.
- Parameters:
x (float) – Specifies the X coordinate of the offset to the new position.
y (float) – Specifies the Y coordinate of the offset to the new position.
Examples:
- offset_selected(picked_entity, side_to_offset, offset_distance, leave_original, sharp_corners)¶
- Summary:
Offsets all selected entities connected to an entity.
- Remarks:
Remember arrays are zero based and collections are one based.
- Returns:
An array of IEntity objects created if any entities were created by this operation.
- Parameters:
picked_entity (IEntity) – The entity that selected entities are connected to.
side_to_offset (IVector) – An absolute point either on the left or the right of the picked entity.
offset_distance (float) – The distance to offset selected entities.
leave_original (bool) – If “leave_original” is TRUE then the entities which are offset are left in the drawing, otherwise they are replaced by the offset result.
sharp_corners (bool) – “sharp_corners” specifies whether blend radii are used to join offsets or whether they are joined by extending to sharp angles.
Examples:
- paste(origin_x, origin_y, position_mode, scale, angle, mirror_x, mirror_y, use_existing_blocks)¶
- Summary:
Pastes entities from the clipboard into the active block.
- Remarks:
The following conditions must be respected, otherwise an error will occur. The scale must be a value greater than zero. The angle must be a value between -360 and 360 degrees inclusive. This method should not be used from the IServer application as there is no clipboard in this context.
- Parameters:
origin_x (float) – Specifies the X coordinate for the origin.
origin_y (float) – Specifies the Y coordinate for the origin.
position_mode (ipPastePositionMode) – Specifies how the origin is determined.
scale (float) – Specifies the scale.
angle (float) – Specififes the angle.
mirror_x (bool) – Specifies if a mirror in the X direction should be applied.
mirror_y (bool) – Specifies if a mirror in the Y direction should be applied.
use_existing_blocks (bool) – Specifies if existing blocks should be respected.
Examples:
- rebridge(options)¶
- Summary:
Rebridges all selected entities in the active block using the specified options.
- Remarks:
Note that the mode rmEditIndividual is currently unavailable. To rebridge an individual entity (without first having to select it), it may be better to use IEntity.bridges.Rebridge.
- Parameters:
options (IRebridgeOptions) – Specifies how entities in this block should be rebridged.
Examples:
- rotate(angle, position, retain, num_copies)¶
- Summary:
Rotates selected entities.
- Parameters:
angle (float) – The angle to rotate the entities.
position (IVector) – The entities are rotated about this point.
retain (bool) – If Retain is TRUE then the original entities will remain in place and copies are made in the rotated positions. If Retain is false then the entities are moved to the rotated positions.
num_copies (int) – Specifies the number of times that the rotation should be applied.
Examples:
- scale(value, origin, retain, num_copies)¶
- Summary:
Scales selected entities.
- Parameters:
value (float) – The scale value.
origin (IVector) – The origin about which to scale.
retain (bool) – If Retain is TRUE then the original entities will be left in place and copies made in the scaled positions. If Retain is FALSE then the entities will be moved to the scaled positions.
num_copies (int) – The number of times the scale should be applied.
Examples:
- scale_asymmetric(x, y, origin, retain, inserts)¶
- Summary:
Asymmetrically scales selected entities.
- Remarks:
Asymmetrically scales selected entities by a specified amount in the X and Y directions, about a specified point.
- Parameters:
x (float) – The scale amount in the X direction.
y (float) – The scale amount in the Y direction.
origin (IVector) – The origin about which to scale.
retain (bool) – If Retain is TRUE then the original entities will be left in place and copies will be placed in the scaled positions. If Retain is FALSE then the entities will be moved to the scaled positions.
inserts (bool) – Specifies if inserts should be affected or not.
Examples:
- scale_asymmetric2(x, y, origin, retain, inserts, bridge_locations, bridge_sizes)¶
- scale_asymmetricd(x, y, origin_x, origin_y, retain, inserts)¶
- Summary:
Asymmetrically scales selected entities.
- Remarks:
Asymmetrically scales selected entities by a specified amount in the X and Y directions, about a specified point.
- Parameters:
x (float) – The scale amount in the X direction.
y (float) – The scale amount in the Y direction.
origin_x (float) – The X coordinate of the origin about which to scale.
origin_y (float) – The Y coordinate of the origin about which to scale.
retain (bool) – If Retain is TRUE then the original entities will be left in place and copies will be placed in the scaled positions. If Retain is FALSE then the entities will be moved to the scaled positions.
inserts (bool) – Specifies if inserts should be affected or not.
Examples:
- scale_asymmetricd2(x, y, origin_x, origin_y, retain, inserts, bridge_locations, bridge_sizes)¶
- scaled(value, origin_x, origin_y, retain, num_copies)¶
- Summary:
Scales selected entities.
- Parameters:
value (float) – The scale value.
origin_x (float) – The X coordinate of the origin about which to scale.
origin_y (float) – The Y coordinate of the origin about which to scale.
retain (bool) – If Retain is TRUE then the original entities will be left in place and copies made in the scaled positions. If Retain is FALSE then the entities will be moved to the scaled positions.
num_copies (int) – The number of times the scale should be applied.
Examples:
- select(entities, selected)¶
- Summary:
Select (or deselect) all of the specified entities in the current block.
- Remarks:
Using this method is equivalent to setting the Selected property of each entity. However if there are many entities, using this method will be faster because it invoves a single update to the Impact user interface. Introduced in Impact 9.0.0.77.
- Parameters:
entities (IEntities) – The entities whose selection property is to be changed.
selected (bool) – Indicates whether the specified entities are to be selected (bTrue) or deselected (bFalse).
Examples:
- select_all()¶
- Summary:
Selects all visible entities in this block.
Examples:
- select_box(box)¶
- Summary:
Selects entities partially enclosed by a specified area.
- Parameters:
box (IRect) – Specifies the rectangular area to select.
Examples:
- select_boxd(left, bottom, right, top)¶
- Summary:
Selects entities partially enclosed by a specified area, using double parameters.
- Parameters:
left (float) – Specifies the left value of the x-axis of the rectangular area to select.
bottom (float) – Specifies the bottom value of the y-axis of the rectangular area to select.
right (float) – Specifies the right value of the x-axis of the rectangular area to select.
top (float) – Specifies the top value of the y-axis of the rectangular area to select.
Examples:
- select_by_line(start, end)¶
- Summary:
Selects entities that intersect a specified line.
- Parameters:
Examples:
- select_by_lined(start_x, start_y, end_x, end_y)¶
- Summary:
Selects entities that intersect a specified line, using double parameters.
- Parameters:
start_x (float) – Specifies the x value of the start coordinate of line.
start_y (float) – Specifies the y value of the start coordinate of line.
end_x (float) – Specifies the x value of the end coordinate of line.
end_y (float) – Specifies the y value of the end coordinate of line.
Examples:
- select_expression(expression, mode)¶
- Summary:
Changes the selection state of specified visible entities in this block.
- Remarks:
This method closely resembles the tool in Impact (Edit > Select > select_expression). If you are unsure of the correct syntax for the Expression, it is recommended that you try using the tool to interactively build and test the expression. If any expression needs to use double-quotes, for example around a palette name string or block name string, then you may need to tweak the expression (depending on which programming language you are using). For example VBScript requires that each double-quote is entered as two double-quotes; see the example code for an example of this.
- Parameters:
expression (str) – Specifies which entities should be selected or deselected.
mode (ipSelectExpressionMode) – Specifies how the selection state of the entities should be changed.
Examples:
- select_none()¶
- Summary:
Deselects all entities in this block.
- select_window(window)¶
- Summary:
Selects entities fully enclosed by a specified area.
- Parameters:
window (IRect) – Specifies the rectangular area to select.
Examples:
- select_windowd(left, bottom, right, top)¶
- Summary:
Selects entities fully enclosed by a specified area, using double parameters.
- Parameters:
left (float) – Specifies the left value of the x-axis of the rectangular area to select.
bottom (float) – Specifies the bottom value of the y-axis of the rectangular area to select.
right (float) – Specifies the right value of the x-axis of the rectangular area to select.
top (float) – Specifies the top value of the y-axis of the rectangular area to select.
Examples:
- smooth(options)¶
- Summary:
Smooths entities.
- Remarks:
Remember arrays are zero based and collections are one based.
- Returns:
A variant array of IEntity objects.
- Parameters:
options (ISmoothOptions) – Specifies the options to use.
Examples:
- switch_selected()¶
- Summary:
Switches the direction of selected entities. If the direction of an entity has been locked then its direction will remain unaltered.
Examples:
- switch_side(entity, mode, left_side, path_only, holding_bridge_both_ends)¶
- Summary:
Switches the side properties (such as bevel side) of an entity.
- Parameters:
entity (IEntity) – Specifies the entity to switch the side of.
mode (ipSwitchSideMode) – Specifies the mode to use.
left_side (bool) – Specifies which side is required.
path_only (bool) – Specifies if all entities on a path defined from the specified entity should be operated on.
holding_bridge_both_ends (bool) – Specifies if the holding bridges should be applied on both sides.
- symbol_insert(symbol, offset, scale, angle, mirror_x, mirror_y, mode)¶
- Summary:
Creates an ISymbolInsert object using relative mode and vector parameters.
- Remarks:
If mode is simAsGeometry null is returned, otherwise if successful an IInsertEntity object is returned.
- Parameters:
symbol (str) – Specifies the name of the symbol to make an insert of. If the symbol has not yet been inserted in the drawing it is loaded from the database.
offset (IVector) – Specifies the offset to the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
mode (ipSymbolInsertMode) – Specifies the mode to use.
Examples:
- symbol_insert_a(symbol, position, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an ISymbolInsert object using absolute mode and vector parameters.
- Remarks:
See also symbol_insert_a2, which allows you to specify a mode (as symbol, as block, as geometry).
- Returns:
If a valid symbol insert is created then an ISymbolInsert object is returned otherwise this method returns NULL.
- Parameters:
symbol (str) – Specifies the name of the symbol to make an insert of. If the symbol has not yet been inserted in the drawing it is loaded from the database.
position (IVector) – Specifies the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- symbol_insert_a2(symbol, position, scale, angle, mirror_x, mirror_y, mode)¶
- Summary:
Creates an ISymbolInsert object using absolute mode and vector parameters.
- Remarks:
If the mode is set to simAsGeometry then null is returned, otherwise if successful an IInsertEntity object is returned.
- Returns:
If a valid symbol or block insert is created then an IInsertEntity object is returned.
- Parameters:
symbol (str) – Specifies the name of the symbol to make an insert of. If the symbol has not yet been inserted in the drawing it is loaded from the database.
position (IVector) – Specifies the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
mode (ipSymbolInsertMode) – Specifies the mode to use.
Examples:
- symbol_insert_ad(symbol, x, y, scale, angle, mirror_x, mirror_y)¶
- Summary:
Creates an ISymbolInsert object using absolute mode and double parameters.
- Remarks:
See also symbol_insert_ad2, which allows you to specify a mode (as symbol, as block, as geometry).
- Returns:
If a valid symbol insert is created then an ISymbolInsert object is returned otherwise this method returns NULL.
- Parameters:
symbol (str) – Specifies the name of the symbol to make an insert of. If the symbol has not yet been inserted in the drawing it is loaded from the database.
x (float) – Specifies the X coordinate of the position of the insert.
y (float) – Specifies the Y coordinate of the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
Examples:
- symbol_insert_ad2(symbol, x, y, scale, angle, mirror_x, mirror_y, mode)¶
- Summary:
Creates an ISymbolInsert object using absolute mode and double parameters.
- Remarks:
If mode is simAsGeometry null is returned, otherwise if successful an IInsertEntity object is returned.
- Returns:
If a valid symbol insert is created then an ISymbolInsert object is returned otherwise this method returns NULL.
- Parameters:
symbol (str) – Specifies the name of the symbol to make an insert of. If the symbol has not yet been inserted in the drawing it is loaded from the database.
x (float) – Specifies the X coordinate of the position of the insert.
y (float) – Specifies the Y coordinate of the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
mode (ipSymbolInsertMode) – Specifies the mode to use.
Examples:
- symbol_insertd(symbol, x, y, scale, angle, mirror_x, mirror_y, mode)¶
- Summary:
Creates an ISymbolInsert object using relative mode and double parameters.
- Returns:
If mode is simAsGeometry null is returned, otherwise if successful an IInsertEntity object is returned.
- Parameters:
symbol (str) – Specifies the name of the symbol to make an insert of. If the symbol has not yet been inserted in the drawing it is loaded from the database.
x (float) – Specifies the X coordinate of the offset to the position of the insert.
y (float) – Specifies the Y coordinate of the offset to the position of the insert.
scale (float) – Specifies the scale of the insert.
angle (float) – Specifies the angle of the insert.
mirror_x (bool) – If mirror_x is TRUE then entities are mirrored in the X direction.
mirror_y (bool) – If mirror_y is TRUE then entities are mirrored in the Y direction.
mode (ipSymbolInsertMode) – Specifies the mode to use.
Examples:
- text_a(anchor, caption, text_style)¶
- Summary:
Creates an IText object using absolute mode and vector parameters.
- Remarks:
If you require the text style of the created text entity to be linked to a text style sheet then use the text_a2 method instead.
- Returns:
If a valid text entity is created then an IText object is returned otherwise this method returns NULL.
- Parameters:
anchor (IVector) – Specifies the anchor point of the text object.
caption (str) – Specifies the caption of the text object.
text_style (ITextStyle) – Specifies the text style to use to create the text.
Examples:
- text_a2(anchor, caption, text_style_sheet)¶
- Summary:
Creates an IText object using absolute mode and vector parameters.
- Parameters:
anchor (IVector) – Specifies the anchor point of the text object.
caption (str) – Specifies the caption of the text object.
text_style_sheet (ITextStyleSheet) – Specifies the text style sheet which the font style of the new text entity will be linked to.
Examples:
- text_ad(x, y, caption, text_style)¶
- Summary:
Creates an IText object using absolute mode and double parameters.
- Remarks:
If you require the text style of the created text entity to be linked to a text style sheet then use the text_ad2 method instead.
- Returns:
If a valid text entity is created then an IText object is returned otherwise this method returns NULL.
- Parameters:
x (float) – Specifies the X coordinate of the anchor point of the text object.
y (float) – Specifies the Y coordinate of the anchor point of the text object.
caption (str) – Specifies the caption of the text object.
text_style (ITextStyle) – Specifies the text style to use to create the text.
Examples:
- text_ad2(x, y, caption, text_style_sheet)¶
- Summary:
Creates an IText object using absolute mode and double parameters.
- Parameters:
x (float) – Specifies the X coordinate of the anchor point of the text object.
y (float) – Specifies the Y coordinate of the anchor point of the text object.
caption (str) – Specifies the caption of the text object.
text_style_sheet (ITextStyleSheet) – Specifies the text style sheet which the font style of the new text entity will be linked to.
Examples:
- tidy_coincident(bridge_mode, overlapping_lines_mode, merge_end_to_end, tolerance, recurse)¶
- Summary:
Merges (or removes) overlapping sections of geometry and optionally merge end to end lines. This method only operates on selected entities.
- Remarks:
Equivalent to using the tool Edit > Tidy > Coincidence in Impact. Note that the tolerance cannot be greater than 1mm (which is 0.0394 inches).
- Parameters:
bridge_mode (ipBridgeMode) – Specifies the bridge mode to user when performing the tidy operation.
overlapping_lines_mode (ipTidyCoincidentOverlappingLinesMode) – Specifies the overlapping lines mode to user when performing the tidy operation.
merge_end_to_end (bool) – Specifies if entities should be merged end to end.
tolerance (float) – Specifies the tolerance.
recurse (bool) – Specifies if the sub blocks are processed.
- tidy_gaps(tolerance, recurse_into_sub_blocks)¶
- Summary:
Tidies the selected entities by attempting to remove gaps between them.
- Remarks:
Equivalent to using the tool Edit > Tidy > Gaps in Impact. Introduced into Impact 12.0.0.159
- Parameters:
tolerance (float) – Any gaps smaller than this value will be tidied
recurse_into_sub_blocks (bool) – If enabled, entities within selected blocks will be tidied
Examples:
- tidy_slots(max_slot_width, max_slot_angle, tidy_flap_slots, tidy_lock_slots)¶
- Summary:
Converts slots with angled ends to slots with radius ends.
- Remarks:
This method operates solely on selected entities. It can identify slots between flaps and replace the base of the slot with a fillet; it can identify lock slots and replace both ends with a fillet. Equivalent to using the tool Edit > Tidy > Slots in Impact.
- Parameters:
max_slot_width (float) – The widest slot that will be edited (measured at the slots narrowest point).
max_slot_angle (float) – The widest angle of slot that will be edited.
tidy_flap_slots (bool) – Specifies whether slots between flaps should be edited.
tidy_lock_slots (bool) – Specifies whether lock slots should be edited.
Examples:
- translate(offset, retain, num_copies)¶
- Summary:
Shifts selected entities.
- Parameters:
offset (IVector) – Defines the amount to shift entities.
retain (bool) – If Retain is TRUE then the original entities will be left in place and copies made in the translated positions. If Retain is false then the entities will be moved to the translated positions.
num_copies (int) – Defines the amount of times the translation is applied.
Examples:
- trim_corner(entity1, entity2, end_point1, end_point2)¶
- Summary:
Modifies two entities, trimming them or extending them so that they join at a corner. The entities may be lines, arcs, circles or beziers.
- Remarks:
end_point1 is a point on the section of Entity1 which is to remain after the corner has been done. Similarly, end_point2 is a point on the section of Entity2 which is to remain.
- Parameters:
Examples:
- trim_intersect(entity1, entity2, end_point1, end_point2)¶
- Summary:
Intersects one entity with another.
- Remarks:
end_point1 is a point on the section of Entity1 which is to remain after the intersect has been done. Only the first entity is extended/trimmed. The second entity is unchanged. To change both entities, use the trim_corner method instead.
- Parameters:
Examples: