Skip to content
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

can not rea dxf file with entity type: "AcDbEntity" . #76

Open
yanweitong opened this issue Oct 22, 2024 · 1 comment
Open

can not rea dxf file with entity type: "AcDbEntity" . #76

yanweitong opened this issue Oct 22, 2024 · 1 comment

Comments

@yanweitong
Copy link

When I used this library to read DXF format files, it worked fine most of the time. But recently when I tried to read some DXF files, I couldn't read the content correctly. When I compared the DXF files, I found that the entity inside was of AcDbEntity type. I didn't find the corresponding one in EntityType. Is this the reason?
a83da7be2772afa91f8eac5e2fb5e5c

@brettfo
Copy link
Member

brettfo commented Nov 9, 2024

Compatibility with other DXF libraries is an ongoing issue. The AcDbEntity you see isn't causing a problem, though. Properties for an entity are commonly grouped under the C++ class that contains those in the AutoCAD source. For example, a line in a DXF file looks like this:

(note, I've added line comments that aren't valid in the DXF, but help explain what's going on)

0              // lines in a DXF file are read in pairs; the first is a code that says what type follows, in this case 0 means start of entity
LINE
100            // this means we're reading properties common to the base entity class
AcDbEntity
8              // code 8 means a layer name follows
WALLS
100            // this means we're now reading properties specific to the line entity
AcDbLine
10             // code 10 means the X coordinate of a primary point; in this case it's really "P1.X"
0
20             // code 20 means the Y coordinate of a primary point; in this case it's really "P1.Y"
0
30             // code 30 means the Z coordinate of a primary point; in this case it's really "P1.Z"
0
11             // code 11 means the X coordinate of a secondary point; in this case it's really "P2.X"
10
21
10
31
0

I didn't label the last few values, but it should be pretty obvious what they are. This snippet defines a line on layer WALLS with a start point of (0, 0, 0) and an end point of (10, 10, 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants