Page 1 of 1

Understanding the MTextData

Posted: Fri Dec 04, 2015 10:54 am
by theZivkovic
Hi people. Can someone describe me how the DL_MTextData actually works?

DL_MTextData(double ipx, double ipy, double ipz,
double dirx, double diry, double dirz,
double height, double width,
int attachmentPoint,
int drawingDirection,
int lineSpacingStyle,
double lineSpacingFactor,
const std::string& text,
const std::string& style,
double angle) :

My guess is that it takes attachmentPoint (let's say TOP-LEFT) and
sets the TOP-LEFT point of the text to be (ipx, ipy, ipz). Then the text is scaled
to the (width, height) size and then rotated by angle. I might be thinking
wrong, because I don't understand how (dirx,diry,dirz) fit here.

So can someone explain me how this text is generated?

Re: Understanding the MTextData

Posted: Fri Dec 04, 2015 12:10 pm
by andrew
http://images.autodesk.com/adsk/files/a ... ce_enu.pdf

ipx, ipy, ipz is the "insertion point" (see DXF specification above)
dirx, diry, dirz is the "X-axis direction vector" (see DXF specification above)

dxflib does not use a direction vector when saving MTEXT entities, it saves the angle (code 50) instead. Contrary to what the DXF specification states, this angle is stored in degrees, not radians. This is an error in the DXF specification.

Re: Understanding the MTextData

Posted: Mon Dec 07, 2015 10:53 am
by theZivkovic
Thanks Andrew, that was helpful.

Best regards,
Dejan Zivkovic