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

Support Dynamic Blocks: Read Evaluation Graphs and Block Visibility Parameters #6

Open
3 tasks done
mme1950 opened this issue Jun 19, 2024 · 0 comments
Open
3 tasks done

Comments

@mme1950
Copy link

mme1950 commented Jun 19, 2024

Objective

We currently implement a converter from DWG to SVG. The converter is aimed to provide SVG fragments (templates) defined in dynamic blocks. An application shall compose these fragments/templates to a complex drawing. This requires that not only block records can be read and converted into SVG groups. Also subsets of entities defined in the dynamic block shall be made accessible in the converter to be converted into SVG (sub)groups of the SVG group representing the block record.

Background

Dynamic block are subgrouped as defined in a BLOCKVISIBILITYPARAMETER object. The BLOCKVISIBILITYPARAMETER is associated with a block record. It essentially defines subsets of the entities of the block record and allows to set one of them optionally visible.

Analysis

Unfortunately there is no documentation available about the data structures, in particular how the BLOCKVISIBILITYPARAMER obejct is linked to the block record object.
This can be undestand by analysing DXF file saved from the DWG file to be read:
A block record that is a dynamic block is associated with a BLOCKVISIBILITYPARAMETER object as follows:

  • The XDictionary associated with a block record that is a dynamic block has an entry named ACAD_ENHANCEDBLOCK.
  • This points to an EVALUATION_GRAPH object.
  • One of the graph nodes points to the BLOCKVISIBILITYPARAMETER object.

The details of the function of the evaluation graph seem not to be important to solve my problem. I also do not need the objects associated with the other nodes of the graph.

Solution Concept

  • Implement a reader for BLOCKVISIBILITYPARAMETER.
  • Implement a reader for the EVALUATION_GRAPH.

The converter then can read the ACAD_ENHANCEDBLOCK dictionary entry from the block-record object, find the graph node with
the BLOCKVISIBILITYPARAMETER, and read the subgrouping to create SVG groups.

The Problems

  • Currently there is no documentation available about EVALUATION_GRAPH and BLOCKVISIBILITYPARAMETER data fields, neither a description of the DWG structure nor DXF group codes.
  • I can guess from the DXF export what the fields of an EVALUATION_GRAPH and its graph nodes should be including the field type. I succeeded to read a EVALUATION_GRAPH, without understanding the meaning of all fields. The result is sufficient to route to the BLOCKVISIBILITYPARAMETER object.
  • Reading the BLOCKVISIBILITYPARAMETER is difficult. The sequence of data in the DXF seems to be different from the DWG data.
  • Evaluation Graph class and Evaluation Graph template
  • Block Visibility Parameter class and Block Visibility ParameterTemplate
  • Reader methods
nka1994 pushed a commit that referenced this issue Nov 21, 2024
…dynamic-blocks-read-evaluation-graphs-and-block-visibility-parameters

Sync Branch 20240619 mme #6 support dynamic blocks read evaluation graphs and block visibility parameters
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

When branches are created from issues, their pull requests are automatically linked.

1 participant