Difference between revisions of "Rotation Matrix"

From Microstation VBA Wiki
Jump to: navigation, search
(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 …')
 
Line 1: Line 1:
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.
+
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:
 
First you dimension a matrix element:

Revision as of 13:28, 6 August 2010

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))