I really need to understand rotation matrices better, I could find my way around the COM methods of rotation but am struggling with the newer non-COM methods.
I'm trying to rotate a textblock 90 degrees in a sheet view.
Mike Robertson said:I really need to understand rotation matrices better
We've published an article that describes a tool to rotate a text element. It's a .NET project for Viz Studio.
The tool is a DgnElementSet sub-class. It lets you pick a text element and then rotate it using one of several methods.
DgnElementSet
Its purpose is to show how to compute a rotation matrix (DMatrix3d), then apply it to an element.
DMatrix3d
Regards, Jon Summers LA Solutions
Hi Jon,
I was able to reproduce the article on your page.Now I have a question about the SPIN command.
Is it possible to move the text to a new position before rotating it?
This would simplify things immensely for us as cartographers when placing the text.This would combine two work steps (Move Element and Rotate Element) into one work step.
RegardsFrank
Frank Schneller said:Is it possible to move the text to a new position before rotating it?
You want to apply both a translation and a rotation.
You can create a translation using DTransform3d.FromTranslation. You already have a rotation. Combine the two using something like DTransform3d.Multiply(DMatrix3d, DTransform3d).
DTransform3d.FromTranslation
DTransform3d.Multiply(DMatrix3d, DTransform3d)
As I wrote previously, this is normal geometric algebra, not specific to MicroStation. You could use a math program such as MATLAB to try this stuff away from MicroStation.
Hi Frank,
As Jon wrote, it is possible. How it should be implemented depends on required workflow: From your last sentence it looks like you want to place (move) the text at first and when positioned, to rotate it in that place?
It requires to extend the code to manage these steps, when clicks are counted, and the tool behaves depending what data point was specified (on general level, it leads to state design pattern).
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point