using (CadImage cadImage = (CadImage)Image.Load(openFileDialog.FileName, loadOptions))
{
for (int i = 0; i < cadImage.Entities.Length; i++)
{
CadEntityBase baseEntity = cadImage.Entities[i];
if(cadEntityBase.baseEntity== CadEntityTypeName.MTEXT)
{
CadMText cadMText = (CadMText)cadEntityBase;
var height = cadMText.HorizontalWidth;
var width = cadMText.ColumnWidth;
var rotation = cadMText.RotationAngleRad; <== I always get 0
var text = cadMText.FullClearText;
cadMText.RotationAngleRad = rotation;
}
}
}
@qor5457,
this value cadMText.RotationAngleRad may be empty for the MTEXT in the file, in this case mtext.DirectionVector stores the direction of angle. In case both of them exist for the MTEXT the mtext.DirectionVector is reliable to calculate the angle.
1 Like