IText¶
- class IText¶
Bases:
IEntity- Summary:
Represents a text entity.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property anchor¶
Gets Anchor.
- Summary:
Sets and gets the text anchor position.
- property block¶
Gets Block.
- Summary:
Returns an IBlock object representing the block that this entity is in.
- property bound_height¶
Gets bound_height.
- Summary:
Gets and sets the bound height of the text.
- Remarks:
This method is currently not implemented; it will raise an error if you use it.
- Returns:
The value of bound_height.
- Return type:
bound_height (float)
- property bound_width¶
Gets bound_width.
- Summary:
Gets and sets the bound width of the text.
- Remarks:
This method is currently not implemented; it will raise an error if you use it.
- Returns:
The value of bound_width.
- Return type:
bound_width (float)
- property bounded¶
Gets Bounded.
- Summary:
Gets and sets the bounded state of the text.
- Returns:
The value of Bounded.
- Return type:
bounded (bool)
- property caption¶
Gets Caption.
- Summary:
Gets the displayed text.
- Remarks:
You should not attempt to write to this property; instead write to the Command property.
- Returns:
The value of Caption.
- Return type:
caption (str)
- property command¶
Gets Command.
- Summary:
Gets and sets the command of the text (and so updates the Caption).
- Remarks:
The command determines what is returned by the Caption property. Command can be set to a simple string or any valid command string (for example including database values or system functions).
- Returns:
The value of Command.
- Return type:
command (str)
Examples:
- property constrained¶
Gets Constrained.
- Summary:
Gets and sets the constrained state of the text.
- Returns:
The value of Constrained.
- Return type:
constrained (bool)
- property drawing¶
Gets Drawing.
- Summary:
Returns an IDrawing object representing the drawing that this entity is in.
- property entity_type¶
Gets entity_type.
- Summary:
Indicates the type of entity.
- Remarks:
Once you know the type of the entity, you can access additional properties. See IAngleDimension, IAnnotationDimension, IArc, IBezier, IBlockInsert, IBorderPlotArea, ICentreDimension, IDimension, IGraphic, IInsertEntity, ILayerInsert, ILeaderDimension, ILine, ILinearDimension, IMasterLayerInsert, IRadiusDimension, IRubberEntity, ISymbolInsert, IText.
- Returns:
The value of entity_type.
- Return type:
- property extents¶
Gets Extents.
- Summary:
Returns an IRect object representing the extents of the entity.
- property geometric¶
Gets Geometric.
- Summary:
Determines if the entity is a geometric entity, i.e. the entity is a line, arc or bezier.
- Remarks:
This property is useful when iterating a list of entities to perform operations on only geometric entities.
- Returns:
The value of Geometric.
- Return type:
geometric (bool)
- property horizontal_position¶
Gets horizontal_position.
- Summary:
Gets and sets the horizontal position of the text.
- Returns:
The value of horizontal_position.
- Return type:
- property palette¶
Gets Palette.
- Summary:
Returns an IPalette object representing the palette of this entity.
- property secondary_palette¶
Gets secondary_palette.
- Summary:
Gets and sets the name of the secondary palette.
- Returns:
The value of secondary_palette.
- Return type:
secondary_palette (str)
- property selected¶
Gets Selected.
- Summary:
Indicates the selected state of the entity.
- Returns:
The value of Selected.
- Return type:
selected (bool)
- property stale¶
Gets Stale.
- Summary:
Use Stale to determine if the entity that this object describes still exists.
- Remarks:
An entity object may become “stale” when the underlying entity no longer exists. If Stale is TRUE then attempting to reference any other method or property of the object will cause an error.
- Returns:
The value of Stale.
- Return type:
stale (bool)
- property text_style¶
Gets text_style.
- Summary:
Gets and sets the text style of the text.
- Returns:
The value of text_style.
- Return type:
- property vertical_alignment¶
Gets vertical_alignment.
- Summary:
Gets and sets the bounding vertical alignment of the text.
- Returns:
The value of vertical_alignment.
- Return type:
- property vertical_position¶
Gets vertical_position.
- Summary:
Gets and sets the vertical position of the text.
- Returns:
The value of vertical_position.
- Return type:
- property visible¶
Gets Visible.
- Summary:
Indicates whether an entity is currently visible.
- Remarks:
This is a read-only property. Any entity’s visibility is affected by factors such as its palette, its layer, its entity type, its block. Note that this property applies to the current window (equivalent to active_drawing.active_window). Introduced in Impact 8.0.0.74
- Returns:
The value of Visible.
- Return type:
visible (bool)
- property word_wrapping¶
Gets word_wrapping.
- Summary:
Gets and sets the state of word wrapping of the text.
- Returns:
The value of word_wrapping.
- Return type:
word_wrapping (bool)
- property x_anchor_offset¶
Gets x_anchor_offset.
- Summary:
Gets and sets the anchor offset in the X direction of the text. (Not implemented)
- Remarks:
This method is currently not implemented; it will raise an error if you use it.
- Returns:
The value of x_anchor_offset.
- Return type:
x_anchor_offset (float)
- property y_anchor_offset¶
Gets y_anchor_offset.
- Summary:
Gets and sets the anchor offset in the Y direction of the text. (Not implemented)
- Remarks:
This method is currently not implemented; it will raise an error if you use it.
- Returns:
The value of y_anchor_offset.
- Return type:
y_anchor_offset (float)
- copy()¶
- Summary:
Makes an identical copy of the entity.
- Remarks:
Note that the new entity goes into the same block as the original entity (not necessarily into the active block). See also copy_to_block method. Introduced in Impact 8.0.0.57
- copy_to_block(block)¶
- Summary:
Makes a copy of the entity, placing it into the specified block.
- Remarks:
Note that the entity’s location in block coordinates will remain constant, meaning that the entity might be moved in the layer (world coordinates). See also Copy method, which copies the entity within the same block. Introduced in Impact 8.0.0.73
- Parameters:
block (IBlock) – The destination block for the entity. This can be an IBlock or an IActiveBlock, allowing you to copy entities to the active sub-block of another layer.
Examples:
- delete()¶
- Summary:
Deletes the entity.
- Remarks:
You need to avoid deleting entities while iterating through a collection of entities, because Impact is likely to crash when trying to find the next entity in the collection. One trick is to step backwards through the collection, as shown in the example script. A better solution is to put the entity objects into another data structure, such as an array or array_list, and then iterate through that structure instead. After calling this method it is an error to access any of the properties (except Stale) or methods of the entity since the entity is “stale”. Prior to Impact 9.0.0.77, Impact would crash if you attempt to delete an entity which is not within the current block (active_block).
Examples:
- explode()¶
- Summary:
Explodes this entity into its component parts. Please do not use this method (see remarks).
- Remarks:
This method is no longer supported. Please use IActiveBlock.explode instead.
- Is(other_entity)¶
- Summary:
Compares this entity object with another one, to see if they actually represent the same entity.
- Remarks:
This method is not for comparing two entities which might be similar. If you copy an entity (using IEntity.copy, for example) then compare using this Is method, it will return False. Introduced in Impact 8.0.0.33.
- Returns:
True if the two objects refer to the same underlying entity.
- Parameters:
other_entity (IEntity) – The entity to be checked against this one.
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.
- point_on_side(point)¶
- Summary:
Determines the side of the entity a given point lies on.
- Remarks:
This method will only return valid results for entities with the following types: etLine etArc etBezier If the entity is not one of the above types then the result of this method will always be esUndefined.
- Returns:
One of the values from the enumeration ipEntitySide.
- Parameters:
point (IVector) – The point to query.
Examples