I'm trying to set the absolute rotation angle for an MText object, irrespective of the active UCS.
I realise that the rotation angle for MText is expressed relative to the active UCS, however, I cannot seem to determine the relationship between the active UCS (via
UCSXDIR) and the direction of DXF group 11 when the MText rotation is set to zero and the UCS is
not parallel with the MText plane.
As a workaround, I have tried altering the WCS vector held by DXF group 11 to the required direction, but cannot seem to alter this value (the
entmod appears successful, but the MText object is not modified) unless the UCS matches the OCS of the MText object.
My last resort was to determine the angle of the DXF group 11 vector when the MText is at zero rotation, and then factor this into my calculations when amending the MText rotation, e.g.:
(defun setmtextrotation
( ent rot
/ enx
) (- rot
)
)
)
)
)
)
)
)
)
)
)
)
)
But I figured there had to be a better way...
Any advice is very much appreciated.