-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dimension: Dimension type and dimension flags #236
Comments
Hi @mme1950 This is the documentation that I've followed:
I the Dxf reader I can see that I'm ignoring bits 7 and 8, all the others seem to have a fixed value depending on the dimension and bit 32 is always set for all compatible versions. I'll open a branch to implement the reader for this values. Thanks for the help! |
Hi @DomCR, I believe it is possible to read the field with group code 70 fron DXF. The values I saw in DXF/ascii seem to be OK. BTW: I would suggest to separate the value into two properties: |
Hi @DomCR, I just tried to test the changes reading sample_AC1032.dwg. |
I was comparing the results with the DXF, maybe I've missed something, I'll reopen the issue and take a second look. |
I spent some time with investigation of this problem (see above). |
For my part I can confirm that the dimension type is not saved in the dwg, the type is specified at the ObjectType so dwg does not need any further specification, the documentation that I've followed and the implementation for this specific issue is this one: //Bit 0 : The OPPOSITE of bit 7(128) of 70.
//Bit 1 : Same as bit 5(32) of the 70(but 32 is not doc'd by ACAD).
//The actual 70 - group value comes from 3 things:
//6 for being an ordinate DIMENSION, plus whatever bits "Flags 1" and "Flags 2" specify.
byte flags = (this._objectReader.ReadByte());
dimension.IsTextUserDefinedLocation = (flags & 0b01) == 0;
dimension.IsOrdinateTypeX = (flags & 0b10) == 0; For me it makes sense and comparing the flags with the dxf seemed to work but I'll take a second look. |
The documentation (pdf) identifies bit 0 and 1 (dwg) with bit 5 and 7, but says nothing about where bit 6 can be found. |
Hi @DomCR, I think I found the solution. I should have read the documentation. I did not expect that part of the value corresponding to the DXF group code 70 appears in the ordinate-dimension data. So I missed it. The three XYZ fields are followed by a non two-bit-coded byte. The lowest bit should be the ordinate flag. see PDF: 20.4.23 DIMENSION (ORDINATE) (20) This seems to work:
|
And we need this line and the new boolean property The The flags should be removed from the |
Good work with the The flag Quote from documentation:
|
If you have a moment could you check the PR for this issue? It seems that you have a more accurate test case than I do, it will help a lot. Thanks |
Hi @DomCR,
Here are the screen shots from AutoCAD and SVG conversion after reading with ACadSharp: |
Dimension type and dimension flags are not read.
In DXF the field with the group code 70 contains an enum value 1...6 representing the dimension type and three flags.
In DWG no field containing the value known from DXF is found.
This field is therefore read in the sequence but not used.
For this field the documentation is available:
Non-bit-pair-coded. NOT the 70 group, but helps define it. Apparently only the two lowest bit are used:
76543210:
Bit 0 : The OPPOSITE of bit 7 (128) of 70.
Bit 1 : Same as bit 5 (32) of the 70 (but 32 is not doc'd by ACAD).
The actual 70-group value comes from 3 things:
6 for being an ordinate DIMENSION, plus whatever bits "Flags 1" and "Flags 2" specify.
In the field read in the sequence only the values 10 or 11 occur (in available examples).
The Dimension Type is not important and can be set in the constructor.
The bits 0, 1 can be extracted as specified. But the meaning is not quite clear. Also the meaning of the other bits is not clear.
The Ordinate bit specifying whether an Ordinate Dimension measures in X or Y direction seems to be missing.
The text was updated successfully, but these errors were encountered: