(Solved) – Shape.Rotation property behavior

  • by
With sketch
    .ScaleHeight 16, msoFalse
    .ScaleWidth 16, msoFalse
    .Fill.Visible = False
    .Line.Weight = 1
    .Line.ForeColor.RGB = RGB(0, 0, 0)
    .Left = XCoordinate
    .Top = YCoordinate
    .Rotation = AngleDeg
End With

This is a code i am writing. I have X and Y coordinate calculated using a formula that changes during every iteration of for loop.

My question is does this shape then go to the given X and Y before rotating itself? Plus, what is the axis of rotation it uses when it rotates by this angle value stored in variable AngleDeg?

I am concerned about this because if this rotates about it’s left top corner, then it is a problem for me because i need it to rotate about axis passing through it’s center point. Same is the reason for why i have my scalewidth and scaleheight properties before this Left and Top properties.

I found that it was using correct X and Y of my center of the sketch (calculated considering origin of the sketch is left top corner), but then it was getting disturbed when it was scaling the sketch which was then moving/messing up the co-ordinates of the center of the sketch.

Please guide.

Leave a Reply

Your email address will not be published. Required fields are marked *