Comments (11)
Just read form http://docs.autodesk.com/ACD/2011/ENU/filesDXF/WS1a9193826455f5ff18cb41610ec0a2e719-79f8.htm
50 | Rotation angle in radians
50 | Column heights; this code is followed by a column count (Int16), and then the number of column heights
That's why AutoCAD doesn't use code 50 for rotation ... and why you type it twice ...
from dxf.
The spec lists code 50 being written multiple times; once as the rotation angle, and then again as column heights, but it's not very clear exactly how the column heights are written. E.g., it says for the second instance of code 50:
Column heights; this code is followed by a column count (Int16), and then the number of column heights
But code 50 is supposed to be a double
, not int16
, but that's not too bad because we can always cast it, but then it says it's followed by the number of column heights. Does this mean if there are 3 column heights of values (1.5, 2.5, 3.5) that it'll write 4 code pairs: 50/3
, 50/1.5
, 50/2.5
, 50/3.5
?
Do you have an example MTEXT
with multiple column heights? I can likely figure out what's expected and make it work appropriately.
On another note, I don't want to skip the first code 50 rotation angle, because other apps might depend on that value, but once I figure out how to handle the subsequent code 50's, the first one won't be a problem.
from dxf.
I have attached an example of DXF with 5 static columns; what I see in the DXF is a somewhat thick structure ACAD_MTEXT_COLUMN_INFO_BEGIN - ACAD_MTEXT_COLUMN_INFO_END with different data on the columns.
Regards,
Davide
from dxf.
Columns.dxf
is specifying its column data in XDATA, not as code 50
values, so unfortunately I can't draw enough information from this to determine exactly how the various code 50
columns are supposed to work. E.g., if you open Columns.dxf
in notepad or any other text editor and look at lines 2229-2274 you'll see where all of this is specified. The column count is either being defined by the value 1070/5
on lines 2243-2244 or the value 1070/5
on lines 2263-2264, but I can't say for certain.
I'm reluctant to add any special handling to this library for the AutoCAD-specific XDATA (denoted by 1001/ACAD
on lines 2229-2230) because:
- It's application specific, not generic to all DXF files
- I haven't seen any official spec from Autodesk about what these values actually mean.
If you want to add this XDATA handling to your own app, you can read (and set for writing) the raw data with something like this:
var dxf = DxfFile.Load("Columns.dxf");
var mtext = dxf.Entities.OfType<DxfMText>().First();
var acadXData = mtext.XData["ACAD"];
// `acadXData` is an `IList<>` that you can enumerate through
Since this issue was opened for the handling of code 50
values I'll leave it open in case more information is gathered.
from dxf.
I agree with you on not managing the columns (by the way I don't care specifically).
But I ask you to remove the other code 50 in order not to have the double repetition as now which is interpreted by AutoCAD as an angle.
Regards,
Davide
from dxf.
Since the spec defines those other code 50 values, I can't remove them, but if I can find an example of how those other values are used I can fix the behavior so that it's correct and the rotation angle isn't overwritten.
If you ever run into a file with MTEXT
with those extra code 50 values, I'd love to see a copy of it so I can see exactly what it's doing.
from dxf.
Maybe I understood: the explanation in the PDF is a bit convoluted but looking (PNG attached) it corresponds to the DXF (attached) I would say that it is "clear": 50 indicates that the next integer data (1070) is the number of columns (5)
Regards,
David
from dxf.
Ohh, this is annoying. The spec doesn't say that these code pairs are double-encoded in XDATA, but the drawing you sent me obviously shows this. It appears that through code 44 (what I call LineSpacingFactor
), the values are in normal code pairs, but the next set of codes introduced in the 2008 spec are really held inside XDATA, even though the spec doesn't say it. I'm hesitant to do more without understanding it better, but could you do me a favor and try to load the file I've attached to this message? It's the same as the Example.dxf
you just posted, but I converted the XDATA back to regular code pairs, e.g., I changed ColumnType
(code 75) from the XDATA form:
1070
75
1070
2
to a normal form:
75
2
I want to see if your version of AutoCAD understands the normal form, or only the XDATA form. Based on how it handles it I'll have to decide what to do.
from dxf.
AutoCad 2015 response: Xdata wasn't read. Invalid or incomplete DXF input -- drawing discarded.
Also Autodesk Viewer 2020 can't read the file.
As you can see from the attachment, the codes you have not put are essential ...
from dxf.
Thanks for checking. I'll think about it a bit and then start working on reading/writing those values from XDATA.
from dxf.
Related Issues (20)
- Unable to associate entity to Dimension, eg. DxfDiameterDimension HOT 1
- Offset of a polyline. HOT 1
- MText: Missing DXF group code: 90 HOT 6
- XData group code exception when casting to string HOT 1
- Position of DxfText is wrong when using HorizontalTextJustification = DxfHorizontalTextJustification.Center HOT 1
- Code 46 not readed from MTEXT HOT 9
- More indexes in code 1, 40 and 290 HOT 3
- How to create a zoom-extents ViewPort?
- Add Aligned Dimension with text above the dimension line and how to increase text size? HOT 1
- spline closed attribute error HOT 3
- How to specify a font for Text? HOT 2
- SPATIAL_FILTER code 40 issue HOT 1
- Ellipse uses wrong extents calculation HOT 1
- From Spline to Dxf HOT 2
- MTEXT AutoCAD 2018 Embedded Object (code 101) issue
- Opening file error "Not a valid DXF file header: `?0`" HOT 9
- How to calculate spline length? HOT 2
- How to get an edge/block's connected units (up & downstream) HOT 1
- How to explicitly set DXF color to black? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dxf.