Skip to content

Commit

Permalink
api: fix GEODATA.north_dir to 2RD
Browse files Browse the repository at this point in the history
also fixes GEODATA imports
  • Loading branch information
rurban committed Nov 27, 2023
1 parent ea2df09 commit c49226b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/dynapi.texi
Original file line number Diff line number Diff line change
Expand Up @@ -9739,7 +9739,7 @@ BL, DXF 92
@item up_dir
3BD, DXF 210
@item north_dir
3BD, DXF 12
2RD, DXF 12
@item scale_est
BL, DXF 95
@item user_scale_factor
Expand Down
2 changes: 1 addition & 1 deletion include/dwg.h
Original file line number Diff line number Diff line change
Expand Up @@ -4243,7 +4243,7 @@ typedef struct _dwg_object_GEODATA
BITCODE_BD unit_scale_vert;
BITCODE_BL units_value_vert; // enum 0-20
BITCODE_3BD up_dir;
BITCODE_3BD north_dir;
BITCODE_2RD north_dir;
BITCODE_BL scale_est; /* None = 1, User specified scale factor = 2,
Grid scale at reference point = 3, Prismodial = 4 */
BITCODE_BD user_scale_factor;
Expand Down
2 changes: 1 addition & 1 deletion src/dwg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6249,7 +6249,7 @@ DWG_OBJECT (GEODATA)
FIELD_BL (units_value_vert, 92); // vert_units
FIELD_3BD (up_dir, 210);
// TODO compute if upgrading
FIELD_2RD (north_dir, 12); // obsolete: 1,1,1
FIELD_2RD (north_dir, 12); // obsolete: 1,1
// Civil3D fields:
FIELD_BL (scale_est, 95); // None = 1 (default: ScaleEstMethodUnity),
// User defined = 2, Grid scale at reference point = 3,
Expand Down
2 changes: 1 addition & 1 deletion src/dynapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -8123,7 +8123,7 @@ static const Dwg_DYNAPI_field _dwg_GEODATA_fields[] = {
0,0,0, 92 },
{ "up_dir", "3BD", sizeof (BITCODE_3BD), OFF (struct _dwg_object_GEODATA, up_dir),
1,0,0, 210 },
{ "north_dir", "3BD", sizeof (BITCODE_3BD), OFF (struct _dwg_object_GEODATA, north_dir),
{ "north_dir", "2RD", sizeof (BITCODE_2RD), OFF (struct _dwg_object_GEODATA, north_dir),
1,0,0, 12 },
{ "scale_est", "BL", sizeof (BITCODE_BL), OFF (struct _dwg_object_GEODATA, scale_est),
0,0,0, 95 },
Expand Down
6 changes: 3 additions & 3 deletions test/unit-testing/dynapi_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -48623,12 +48623,12 @@ static int test_GEODATA (const Dwg_Object *obj)
fail ("GEODATA.host_block [H]");
}
{
BITCODE_3BD north_dir;
BITCODE_2RD north_dir;
if (dwg_dynapi_entity_value (geodata, "GEODATA", "north_dir", &north_dir, NULL)
&& !memcmp (&north_dir, &geodata->north_dir, sizeof (BITCODE_3BD)))
&& !memcmp (&north_dir, &geodata->north_dir, sizeof (BITCODE_2RD)))
pass ();
else
fail ("GEODATA.north_dir [3BD]");
fail ("GEODATA.north_dir [2RD]");
}
{
BITCODE_BD north_dir_angle_deg;
Expand Down

0 comments on commit c49226b

Please sign in to comment.