|
Description
|
Modifies the geometrical data of an entity.
|
|
Syntax
|
[form.]DXFReader.ModifyEntity (EntityNumber As Long, [BasePointX As Single], [BasePointY As Single], [RotationAngle As Single], [ScaleX As Single], [ScaleY As Single], [TranslationX As Single], [TranslationY As Single])
|
|
Remarks
|
If the entity indicated by the EntityNumber parameter does not exist in the loaded DXF file an Error 99 ("Entity not found") is generated. All trasformations are about the(BasePointX, BasePointY) point and will change the entity data in the drawing's database.
The following code will rotate every line in the drawing about their middle point:
Dim Entity as Object Dim n as Long Dim PmX as Single Dim PmY as Single
n = 0
With DXFReader1
For Each Entity In .Entities
n = n + 1 If Entity.EntityType = "LINE" Then
PmX = (Entity.X0 + Entity.X1) / 2 PmY = (Entity.Y0 + Entity.Y1) / 2
.ModifyEntity n, PmX, PmY, 30
End If
Next Entity End With
The parameters for the ModifyEntity method are described below:
| EntityNumber | The entity number | | BasePointX | (Optional) The X coordinate of the base point for all trasformations (Default value = 0) | | BasePointY | (Optional) The Y coordinate of the base point for all trasformations (Default value = 0) | | RotationAngle | (Optional) Value in degrees. Setting this property to a non zero value will rotate the entity (Default value = 0) | | ScaleX | (Optional) Setting this property will scale the entity along the X axis (Default value = 1) | | ScaleY | (Optional) Setting this property will scale the entity along the Y axis (Default value = 1) | | TranslationX | (Optional) Setting this property will translate the entity about the X axis (Default value = 0) | | TranslationY | (Optional) Setting this property will translate the entity about the Y axis (Default value = 0) |
|