Rotation Matrix

From Microstation VBA Wiki
Revision as of 14:05, 5 August 2010 by Ted (talk | contribs) (Created page with 'To rotate cells or text when they are placed, you have to supply a Rotation Matrix. If you don't want any roation you can use the built-in constant Matrix3dIdentity. But …')
(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 roation 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))