Hi everyone.
I'm using a transformation matrix to adjust objects scale.
Sub Scale()
[...]
''Definition of the matrix
Dim ScaleMatrix(0 To 15) As Double
ScaleMatrix(0) = X_ScaleFactor
ScaleMatrix(1) = 0
ScaleMatrix(2) = 0
ScaleMatrix(3) = 0
ScaleMatrix(4) = 0
ScaleMatrix(5) = Y_ScaleFactor
ScaleMatrix(6) = 0
ScaleMatrix(7) = 0
ScaleMatrix(8) = 0
ScaleMatrix(9) = 0
ScaleMatrix(10) = Z_ScaleFactor
ScaleMatrix(11) = 0
ScaleMatrix(12) = 0
ScaleMatrix(13) = 0
ScaleMatrix(14) = 0
ScaleMatrix(15) = 1
Dim acScaleMatrixt3d As Matrix3d = New Matrix3d(ScaleMatrix)
[...]
''Perform scale of a polyline
acPoly.TransformBy(acScaleMatrixt3d)
[...]
End Sub
If X_ScaleFactor = Y_ScaleFactor all works fine, but if X_ScaleFactor <> Y_ScaleFactor (e.g. X_ScaleFactor = 2 and Y_ScaleFactor = 4 I get the following exception: eCannotScaleNonUniformly.
It isn't possible to define different scale factors for X and Y axis? It seems a strange thing.
Any suggestion?
Thanks in advance.
Solved! Go to Solution.
Solved by artc2. Go to Solution.
Polylines don't allow non-uniform scaling because they can have arc segments which would become ellipise segments if the scaling is not uniform and ellipse segments are not supported by polylines.
You'd have the same problem trying to non-uniformly scale an arc or a circle.