Comments (6)
Can you attach two files, both before and after the MTEXT corruption? I might be able to look at the differences and figure out what's going on. If you don't want the files to be public you can email them directly to me at brett.forsgren @ outlook.com and I'll keep them private and delete them as soon as I'm done.
from dxf.
I did another 2 tests even simpler:
1st:
var a = DxfFile.Load(File);
a.Entities.Where(x => x.EntityType == DxfEntityType.MText).ToList().ForEach(x =>
{
if (a.Entities.Remove(x))
{
a.Entities.Add(x);
}
});
a.Save(Path.Combine(Path.GetDirectoryName(File), "aaa.dxf"));
result: file corrupted
2nd even more basic:
var a1 = DxfFile.Load(File);
a1.Save(Path.Combine(Path.GetDirectoryName(File), "bbb.dxf"));
result: file corrupted
AutoCAD error detail:
The following error was encountered while reading
in MTEXT starting at line 2414:
Missing DXF group code: 90
Invalid or incomplete DXF input -- drawing discarded
I created file with AutoCAD 2015 and put only a multiline text.
Regards,
Davide
from dxf.
Thank you for the file! Unfortunately it seems that AutoCAD isn't following their own spec (page 139), so this may take me a while to figure out.
If you're interested, the MText in the working file (Test MText.dxf) is on lines 2189 to 2258, and in the non-working file (bbb.dxf) is on lines 2413 to 2524, but the one that this library writes does contain a code 90 on line 2465.
from dxf.
I've done some tests.
The most trivial was to remove the 90 (with its value) but nothing has changed.
I then exported with another package and it works; so I took the MTEXT part of the save that goes and put in place of your MTEXT part and now yours goes too; so the problem is (should) only in the MTEXT piece.
I manually added 90 with the values 0,1,2 and it keeps going (I have attached the files).
I also made a comparison of your save and I attached the report.
Unfortunately I was not able to do an identical export (in the one done with the other package the coordinates are all rounded) and the layer is different but otherwise nothing should change.
Hope this can help you find the problem faster.
One last note: AutoCAD Viewer 2020 does not open them, but AutoCAD 2015 does.
Regards,
Davide
Test MText alternative +90.zip
from dxf.
I have found problem: I have removed code from 420 to 441 and 63 and now your save is ok.
Code 63 must exist only if 90 is 1 (see spec) and I think also code from 420 to 439 (really to 441).
You save two times code 430 and 50.
https://help.autodesk.com/view/OARX/2020/ENU/?guid=GUID-5E5DB93B-F8D3-4433-ADF7-E92E250D2BAB
Regards,
Davide
from dxf.
Thank you for figuring this out! I just pushed commit fef3892 to main
that fixes this.
from dxf.
Related Issues (20)
- Double Bug in MText rotation HOT 11
- 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
- Unsupported code pair of dxf is swallowed HOT 2
- load the library from IronPython HOT 2
- DxfEllipse - thickness missing HOT 6
- Mirrored coordinates of some entries. HOT 3
- Support for MLeader HOT 2
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.