This project has moved. For the latest updates, please go here.

Dimensions in R12/later versions

Nov 13, 2012 at 2:16 PM

Hello,

thanks for this useful project. Probably a stupid question:

In R12 file, each dimension is a *D block with 6 entities (3x line, 2x solid and 1x text).
In later versions (2000), there are *D blocks, but without that text.

What is the correct approach to get a dimension text?

Thanks a lot!

Coordinator
Nov 14, 2012 at 6:59 AM

The dxf documentation can be very confusing at times and very often it lacks a lot of info. It seems that the block you are talking about, the one that makes the actual drawing of the dimension, in R12 dxf version the text that holds the measurements (or optionally any other text the user might have written) is saved as a TEXT entity while in version 2000 and newer is saved as an MTEXT entity.

Looking at the file generated for a linear dimension (different dimension types will vary):

- in R12 file the block (*D2 in my sample) is made of 4 lines (reference lines), 2 solids (the arrows), 3 points (dimension reference points) and an insert which block (*U3) holds the text. It might be this way (this is just a guess) so the dimension can have multiple text lines split in several TEXT entities.

- in R2000 and newer the block has the same number of entities but instead of using an insert that holds the dimension text, it uses directly an MTEXT entity.

I don't know what might happen if you use a R12 rules in a dimension saved as a dxf 2000 version. The use of MTEXT is an upgrade while TEXT entities only hold a single line, MTEXT entities can hold many. Since I have dropped support for R12 files I would follow the 2000 route, but the MTEXT entity is not implemented (we can work on it).

 

Daniel

There are no stupid questions only stupid answers.

Nov 14, 2012 at 10:23 AM

Thanks for the explanation.

What I'm doing is: I just open dxf file (there will be parametrizings/assemblings from multiple parts in the future) and draw the Faces3d, Lines, Solids etc. by simple using them as 3d vertices in OpenGL.

As I need to draw the dimensions with texts (i.e. values in millimetres), I'll use R12 for now and look forward to future netDxf versions that would make these values accessible in 2000+ versions via MTEXT entity.

Coordinator
Nov 14, 2012 at 12:01 PM

I have almost finished to implement the basic functionality of the MTEXT entity, since this will be needed for the dimensions. There are a bunch of internal string codes, like the "\P" to define a new paragraph, that I still need to decide how to handle them.

Daniel

Nov 26, 2012 at 10:00 AM

I've just downloaded the latest source and I can see the MTEXT entities in dimension blocks of the AC2000 dxf file now.

Thanks for the implementation.