Rotation Matrix

From Microstation VBA Wiki
Revision as of 13:28, 6 August 2010 by Ted (talk | contribs)
Jump to: navigation, search

To rotate cells or text when they are placed, you have to supply a Rotation Matrix. If you don't want any rotation you can use the built-in constant Matrix3dIdentity. But if you want any rotation you need to come up with one on your own.

First you dimension a matrix element:

Dim oMatrix as Matrix3d

Fortunately there is a command that will create a basic rotation matrix given an angle in radians and the axis about which you want to rotate. For 2D drawings, that axis will always be Z which is indicated by the number 2.

oMatrix = Matrix3dFromAxisAndRotationAngle(2, Radians(180))