Understanding the MTextData

Use this forum to ask questions about how to do things in dxflib.

Moderator: andrew

theZivkovic
Junior Member
Posts: 12
Joined: Thu Dec 03, 2015 11:20 am

Understanding the MTextData

Postby theZivkovic » Fri Dec 04, 2015 10:54 am

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?

User avatar
andrew
Site Admin
Posts: 5292
Joined: Fri Mar 30, 2007 6:07 am

Re: Understanding the MTextData

Postby andrew » Fri Dec 04, 2015 12:10 pm

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.

theZivkovic
Junior Member
Posts: 12
Joined: Thu Dec 03, 2015 11:20 am

Re: Understanding the MTextData

Postby theZivkovic » Mon Dec 07, 2015 10:53 am

Thanks Andrew, that was helpful.

Best regards,
Dejan Zivkovic


Return to “dxflib 'How Do I' Questions”

Who is online

Users browsing this forum: No registered users and 1 guest