Skip to content

DWG: center-justified ATTDEF loses its insertion point (becomes the alignment point) #2464

Closed

Description

@assamaral

Summary. On a combo build (v0.14.0 + #2107 + #2132 + #2400), a DXF converted to DWG loses the ATTDEF insertion point when the definition is center-justified (group 72 = 1) and the alignment point (group 11) is more than about 1.4 units from the insertion point. ZWCAD 2025 then reports the insertion point equal to the alignment point. The same DXF converted to DXF is unchanged.

Evidence (ZWCAD 2025, DXFOUT of the opened file, 88 ATTDEF in model space of a private production drawing).

  • Original DXF opened directly, and the same DXF saved as DWG by ZWCAD and reopened: all 88 ATTDEF unchanged (control).
  • cadcraft-cli convert in.dxf out.dxf: all 88 unchanged.
  • cadcraft-cli convert in.dxf out.dwg: 68 of 88 changed, 20 unchanged. Changed ones have (11.x - 10.x) between 1.94 and 4.53; unchanged ones between 0.97 and 1.36. Example: 10=(485.204,1660.310), 11=(488.019,1660.310) becomes 10=(488.019,1660.310), 11 unchanged. Height 2.5, text style ARIAL, flags 8, value empty.
  • Effect: plot pixel difference against the original rises from 1.2-2.3 % (DXF output) to 3.0-5.6 % (DWG output, 13 % on the sheet with most of these definitions).

Minimal input to try (not yet run by me on a synthetic file).

0
ATTDEF
8
0
10
0.0
20
0.0
30
0.0
40
2.5
1

7
STANDARD
72
1
11
3.0
21
0.0
31
0.0
3

2
TAG
70
8
74
0

Convert to DWG, open in ZWCAD or AutoCAD, list the attribute definition: the insertion point should stay at (0,0) with the alignment point at (3,0).

The writer in acadrust 0.6.6 (write_text_entity_data) passes both points, so this may be on the reader side or in how the second point is encoded; I did not isolate it. Related: #2229 (justified TEXT in DWG).

Activity

  1. assamaral commented on Oct 29, 2026

    @assamaral
    ContributorAuthor

    Cause found, not in acadrust: the CADCraft DWG bridge replaces a justified text's insertion point by the computed baseline start when the stored one is not within 0.1 * width + 0.5 * height of it (#1050), and an ATTDEF with an empty default value has width 0, so the limit was half a height (1.25 at height 2.5, matching the 1.0 / 1.36 split above). Fixed in #2466, tested in ZWCAD 2025 with a synthetic drawing (main: group 10 equals group 11 in all four ATTDEFs; branch: kept).

  2. ticket-craft commented on Oct 30, 2026

    @ticket-craft

    This is being worked on in #2466.

    Possibly related: #1050, #2229 and #1658.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions