Skip to content

Double Bug in MText rotation #184

@rocchellid

Description

@rocchellid

There is a double problem about the rotation angle in MText: the first is that you write it twice, the first correct and the second at 0, so when you read the DXF the 2nd overwrites the first and therefore all the writings are at 0.
The second problem is that in reality AutoCAD never writes code 50 (the angle) but only compiles 11 and 21 from which the angle is obtained; indeed the 50 gives him his own annoyance.
In practice, never write 50.
Or remove the data (which is always 0 in reading as it never appears in a DXF) or you calculate it by doing:
Read: (360M - Angle.FromRadiant (Math.Atan2 (MText.XAxisDirection.X, MText.XAxisDirection.Y)) + 90M)
Write: XAxisDirection = new DxfVector (Rotation.Cos (), Rotation.Sin (), 0)
Tested with AutoCAD 2015.
Regards,
Davide

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions