Discussion forum
?CAD discussions, advices, exchange of experience

Please abide by the rules of this forum.
|
Post Reply ![]() |
Author | |
Harbin ![]() Newbie ![]() Joined: 24.Jan.2011 Location: United States Using: AutoCad2008 Status: Offline Points: 3 |
![]() Posted: 24.Jan.2011 at 19:57 |
Can anyone help for reading DXF MTEXT file? When dxf file is opened by notepad, MTEXT block is as following. MTEXT
5 430 102 {ACAD_XDICTIONARY 360 78D 102 } 330 1F 100 AcDbEntity 8 TEXT 100 AcDbMText 10 5.704296354278894 20 4.855478660749818 30 0.000000000024344 40 0.0625 41 1.0 71 1 72 5 1 {\W5.6142; }Starts From \P{\W6.96748; }INDICATOR ABC 73 1 44 1.0 1001 ACAD 1000 MTEXTBEGIN 1070 73 1070 1 1070 44 1040 1.0 1070 74 1070 0 1000 MTEXTEND Here is the issue:
group code 71, 1 means this MTEXT is aligned at Top Left.
But actually this MTEXT is aligned at Center. When I open this file by AutoCAD, the contents of property start with "\pxqc;". I think it means "align center" and these special characters are not shown when openning by notepad. So, {\W5.6142; } must be related to "\pxqc;".
Can anyone help to find the actual MTEXT starting location by using: 105.704296354278894 20 4.855478660749818 1
{\W5.6142; }Starts From \P{\W6.96748; }INDICATOR ABC Thank you very much, any help is appreciated.
Harbin
|
|
![]() |
|
CarlB ![]() Senior Member ![]() Joined: 16.Oct.2009 Location: United States Status: Offline Points: 321 |
![]() |
Well 10 & 11 are supposed to be X & Y values of insertion point.
Value of 1 for code 71 is supposed to be Top left justification. So I don't see anything to explain why you found different justification..
Here are some mtext formatting codes that may expalin some things:
Format code Purpose
\0...\o Turns overline on and off \L...\l Turns underline on and off \~ Inserts a nonbreaking space \\ Inserts a backslash \{...\} Inserts an opening and closing brace \File name; Changes to the specified font file \Hvalue; Changes to the text height specified in drawing units \Hvaluex; Changes the text height to a multiple of the current text height \S...^...; Stacks the subsequent text at the \, #, or ^ symbol \Tvalue; Adjusts the space between characters, from.75 to 4 times \Qangle; Changes obliquing angle \Wvalue; Changes width factor to produce wide text \A Sets the alignment value; valid values: 0, 1, 2 (bottom, center, top) Note: Use curly braces ({ }) to apply a format change only to the text within the braces. You can nest braces up to eight levels deep. |
|
![]() |
|
Harbin ![]() Newbie ![]() Joined: 24.Jan.2011 Location: United States Using: AutoCad2008 Status: Offline Points: 3 |
![]() |
Hi CarlB, Thank you for your reply. Actually I am C# programmer and know only a little about AutoCAD. Just like you said: Code 71 =1 means Top Left justification. But, do you know what {\w5.6142;} means? When I open that DXF file in AutoCAD and check the property of that particular MTEXT part: Contents : \pxqc;Starts From\P and so on. Justification: Top Left ---- this matches code 71=1 When I click the particular MTEXT ( for modification purpose???, I can modify the MTEXT contents), I found “ When I open that DXF by notepad, code 1 contents start with {\w5.6142;}. So, I said {\w5.6142;} was related to \pxqc; . Do you have any idea about it? MTEXT top left coordinate can be retreived from code 10 and 20. Since the actual justification is top center, the value {\w5.6142;} should be used to move text contents to right a little bit. I tried to add 5.6142 to x coordinate. It was incorrect.
Please forgive me my unprofessional terminology. I hope you can understand what I am trying to explain. Maybe I need to provide some screen shots.
TIA.
Harbin
Edited by Harbin - 25.Jan.2011 at 07:54 |
|
![]() |
|
CarlB ![]() Senior Member ![]() Joined: 16.Oct.2009 Location: United States Status: Offline Points: 321 |
![]() |
The \Wnnn is format code for adjusting the width factor.
The \pxnnn is format code for different paragraph formatting, such as centered, right/left justify, etc.
See this site for some examples:
It would be tough to figure actual text location after considering justification (71 code), text reference rectangle width (41 code), then paragraph formatting...
|
|
![]() |
|
Harbin ![]() Newbie ![]() Joined: 24.Jan.2011 Location: United States Using: AutoCad2008 Status: Offline Points: 3 |
![]() |
Thanks anyway.
Looks like it is hard to calculate the acutual TEXT starting coordinates.
{\w5.6142; }: insert two spaces with width value 5.6142 ? But the reference rectangle width is only 1.0.
Here is my solution:
If contents start with "{\w", change the justification of this TEXT to (Top/Middle/Bottom) Center.
CarlB, do you think it is going to work?
Thanks again,
Harbin
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
This page was generated in 0,157 seconds.