IShape¶
- class IShape¶
Bases:
ImpactCOMWrapperBase- Description:
A closed region (or regions), independent of any layer.
- Remarks:
Shapes may be created or modified without affecting any drawing. You may use the copy_to_block method to generate entities from the shape, which does modify the chosen drawing. A shape might actually define a number of regions (meaning it has sub-shapes) and it might also have any number of voids (internal shapes) - see subshape_count, Subshape, internal_count and Internals for more information. Introduced in Impact 8.0.0.66
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property extents¶
Gets Extents.
- Description:
Gets the extents of the shape.
- Remarks:
Introduced in Impact 9.0.0.57
- property internal_count¶
Gets internal_count.
- Description:
The number of internals (voids) in this shape.
- Remarks:
Introduced in Impact 8.0.0.66
- Returns:
The value of internal_count.
- Return type:
internal_count (int)
- Examples:
- property subshape_count¶
Gets subshape_count.
- Description:
The number of sub-shapes making up this shape.
- Remarks:
A simple shape (say a rectangle) will have 1 sub-shape. By uniting that shape with another non-overlapping simple shape, you will get one shape which has two sub-shapes. Introduced in Impact 8.0.0.66
- Returns:
The value of subshape_count.
- Return type:
subshape_count (int)
- Examples:
- area()¶
- Description:
The area of the shape.
- Remarks:
If the shape has internal voids, the area is decreased accordingly. Introduced in Impact 8.0.0.66
- clip_entity(entity)¶
- Description:
Removes any parts of the entity which lie outside of the shape.
- Remarks:
This method only operates on geometric entities, for example not on dimernsions, text, symbols, blocks. Note that the original entity is always deleted, even if seemingly unaffected by the operation. Zero, one or more new entities are created for any resultant geometry. Introduced in Impact 8.0.0.66 It is recommended that clip_entity2 is used instead, because that method returns the new entities.
- Parameters:
entity (IEntity) – The geometric entity to be clipped.
- Examples:
- clip_entity2(entity)¶
- Description:
Removes any parts of the entity which lie outside of the shape.
- Remarks:
This method only operates on geometric entities, for example not on dimernsions, text, symbols, blocks. Note that the original entity is always deleted, even if seemingly unaffected by the operation. Zero, one or more new entities are created for any resultant geometry. Introduced in Impact 10.0.0.77
- Parameters:
entity (IEntity) – The geometric entity to be clipped.
- copy_to_block(block)¶
- Description:
Creates entities representing the shape, in the specified block.
- Remarks:
Introduced in Impact 8.0.0.66
- Returns:
A collection of the created entities.
- Parameters:
block (IBlock) – The block in which to create the entities.
- Examples:
- difference(value)¶
- Description:
Subtracts one shape from another, thereby creating a new shape.
- Remarks:
Difference, Intersection and Union are often refered to as “boolean operations”. Introduced in Impact 8.0.0.66
- Returns:
The resultant shape (which might have several sub-shapes).
- Parameters:
value (IShape) – The shape to be subtracted.
- encloses_entity(entity)¶
- Description:
Determines whether the specified entity lies within the shape.
- Remarks:
This method only operates on geometric entities, for example not on dimernsions, text, symbols, blocks. The entity might be fully or partially within the shape, or totally outside of it. Introduced in Impact 8.0.0.66
- Parameters:
entity (IEntity) – The entity to be compared.
- Examples:
- encloses_point(point)¶
- Description:
Determines whether the specified point lies within the shape.
- Remarks:
Introduced in Impact 8.0.0.66
- Parameters:
point (IVector) – The point to be compared.
- Examples:
- internals()¶
- Description:
Creates a new shape using the internals (voids) in this shape.
- Remarks:
Introduced in Impact 8.0.0.66
- Returns:
The new shape
- intersection(value)¶
- Description:
Intersects one shape with another, thereby creating a new shape.
- Remarks:
Difference, Intersection and Union are often refered to as “boolean operations”. Introduced in Impact 8.0.0.66
- Returns:
The resultant shape (which might have several sub-shapes).
- Parameters:
value (IShape) – The shape to be intersected.
- mask_entity(entity)¶
- Description:
Removes any parts of the entity which lie within the shape.
- Remarks:
This method only operates on geometric entities, for example not on dimernsions, text, symbols, blocks. Note that the original entity is always deleted, even if seemingly unaffected by the operation. Zero, one or more new entities are created for any resultant geometry. Introduced in Impact 8.0.0.66 It is recommended that mask_entity2 is used instead, because that method returns the new entities.
- Parameters:
entity (IEntity) – The geometric entity to be masked.
- Examples:
- mask_entity2(entity)¶
- Description:
Removes any parts of the entity which lie within the shape.
- Remarks:
This method only operates on geometric entities, for example not on dimernsions, text, symbols, blocks. Note that the original entity is always deleted, even if seemingly unaffected by the operation. Zero, one or more new entities are created for any resultant geometry. Introduced in Impact 10.0.0.77
- Parameters:
entity (IEntity) – The geometric entity to be masked.
- offset_bigger(offset_value, smooth_corners)¶
- Description:
Creates a new shape from this one, by offsetting outwards.
- Remarks:
Introduced in Impact 8.0.0.66
- Returns:
The new shape.
- Parameters:
offset_value (float) – The distance for the offset.
smooth_corners (bool) – Use True for rounded corners, or False for squared corners.
- Examples:
- offset_smaller(offset_value, smooth_corners)¶
- Description:
Creates a new shape from this one, by offsetting inwards.
- Remarks:
Introduced in Impact 8.0.0.66
- Returns:
The new shape.
- Parameters:
offset_value (float) – The distance for the offset.
smooth_corners (bool) – Use True for rounded corners, or False for squared corners.
- remove_internals()¶
- Description:
Removes all internal voids from the shape.
- Remarks:
Introduced in Impact 8.0.0.66
- Examples:
- subshape(index)¶
- Description:
Retreives one sub-shape from this shape.
- Remarks:
Introduced in Impact 8.0.0.66
- Parameters:
index (int) – Gets an IShape object with the specified index (starts at zero).
- union(value)¶
- Description:
Unites one shape with another, thereby creating a new shape.
- Remarks:
Difference, Intersection and Union are often refered to as “boolean operations”. Introduced in Impact 8.0.0.66
- Returns:
The resultant shape (which might have several sub-shapes).
- Parameters:
value (IShape) – The shape to be united.