Rotation Matrix

From Microstation VBA Wiki
Revision as of 18:20, 6 August 2010 by Ted (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
oMatrix = Matrix3dIdentity

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

oMatrix = Matrix3dFromAxisAndRotationAngle(2, Radians(180))