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

What about BLOCK_HEADER in DWG->JSON conversion in preR13? #818

Open
michal-josef-spacek opened this issue Aug 24, 2023 · 3 comments
Open

Comments

@michal-josef-spacek
Copy link
Contributor

Actual situation:

Example (Blank AC2.10 DWG file)
BLANK.DWG.gz
After conversion to JSON, there is BLOCK_HEADER in the form:

...
{
}
...

Because code (in src/out_json.c):

...
     case DWG_TYPE_BLOCK_HEADER:
      if (dat->version <= R_12
          && strEQc (obj->tio.object->tio.BLOCK_HEADER->name, "*MODEL_SPACE"))
        {
          LOG_TRACE ("Skip *MODEL_SPACE\n");
          return 0;
       }
...

Which generates an ERROR log in conversion from JSON to DWG:

ERROR: Required (null).type missing, skipped

Because JSON {}.

I think that is bad.
Some possibilities:

  1. Remove {} from JSON, this means no error log.
  2. Remove the code above and generate JSON code like:
    {
      "object": "BLOCK_HEADER",
      "index": 5,
      "type": 49,
      "handle": [0, 1, 31],
      "size": 0,
      "flag": 0,
      "name": "*MODEL_SPACE",
      "block_offset_r11": 4294967295,
      "unknown_r11": 0
    },

Which seems somehow right.
The result after conversion from JSON to DWG is fine.

@Ruban What do you think?

@rurban
Copy link
Contributor

rurban commented Sep 5, 2023

I forgot why I skipped it there. It can be skipped in encode easier.
Variant 2 please

@michal-josef-spacek
Copy link
Contributor Author

I forgot why I skipped it there.

I think that was some issue here some time ago.

It can be skipped in encode easier. Variant 2 please

Ok, actually is fine I believe.

PR: #834

@michal-josef-spacek
Copy link
Contributor Author

I need to look. There were more changes in e5f27c1

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