Hello. My name is Yoshio Chino. I work as a composer and CAD operator in Kyotanabe, Kyoto, Japan.
In this article, I will describe a method of organizing information contained in DXF files into JSON format so that it can be used when consulting generative AI.
Converting relevant DXF information into a structured JSON format can make it easier to ask generative AI about differences between drawings, changes made during revisions, and possible inconsistencies in specifications.
This method may be useful when you have questions about a drawing but are unsure what information you should provide to an AI system.
DXF Files Can Be Difficult to Interpret Directly
A DXF file is a text-based file, but it contains many descriptions intended to represent the internal structure of CAD data.
As a result, it can be difficult for a person to read a DXF file in a text editor. It may also be difficult for generative AI to examine the original DXF data without first reorganizing it.
One possible approach is to extract the information needed for review, such as lines, circles, text, dimensions, and layers, and organize it in JSON format.
{
"entity_type": "LINE",
"layer": "FRAME",
"start": [0, 0],
"end": [1200, 0]
}
The purpose of converting DXF data into JSON is not necessarily to reproduce the original drawing perfectly.
The main purpose is to organize information from the drawing into a form that is easier to search, compare, and explain. The resulting JSON can then be used as supporting material when consulting generative AI.
By limiting the output to the information required for a particular review, it may become easier to ask questions about revisions, annotations, dimensions, and possible specification conflicts.
Comparing Drawings Before and After a Revision
If both the original and revised DXF files are converted into JSON, generative AI can assist with checking items such as:
- Added or deleted text and dimensions
- Changes in the number of entities on each layer
- Changes to lines, circles, text, and other objects
- Old notes or model numbers that may still remain in the drawing
- Changes in the positions or dimensions of specific elements
- Differences that may require further investigation
This can provide another way to review a drawing in addition to visually comparing the two versions.
However, small differences in coordinates or rounding during conversion may cause objects that are effectively identical to be reported as changes.
For this reason, AI-generated results should be treated as clues for locating areas that require review, rather than as final conclusions.
Asking Generative AI to Create a Locally Running HTML Tool
A simple tool for converting DXF data into JSON can also be created with the assistance of generative AI.
For example, you could use the following prompt:
Create a locally running HTML file that loads a DXF file in a web browser and exports information about lines, circles, text, dimensions, and layers in JSON format.
If the tool is built using only HTML and JavaScript, it may be possible to load a DXF file in a browser and convert it into JSON on the local computer.
This is an important consideration when working with confidential drawings because the original file does not need to be uploaded to an external server.
However, you should verify, as far as reasonably possible, that the generated code does not communicate with external services.
If the HTML file loads JavaScript libraries from a content delivery network, or CDN, the tool is not operating completely offline. When necessary, those libraries should also be stored locally.
When using company drawings, you must also follow your organization’s information-security policies and internal rules.
Some Information May Be Lost During Conversion
Depending on how the conversion tool is designed, not all information contained in a DXF file will necessarily be preserved in the JSON output.
Particular care may be required for the following types of information:
- Relationships between block definitions and block references
- Blocks containing attributes
- Dimension styles
- Linetypes and lineweights
- Hatches
- User coordinate systems and other coordinate information
- External references
- 3D data
- CAD application-specific extended data
- Units and drawing scales
- Character encodings and special characters
For example, if a block is expanded into individual lines and text objects during conversion, its visual appearance may still be available, but the structural information indicating that those elements originally belonged to the same block may be lost.
This may be sufficient when the purpose is only to review text or dimensions.
However, a more detailed conversion process will be required if the goal is to reconstruct the original DXF file or examine block structures, dimension styles, and external references.
It is therefore more appropriate to regard the JSON file as an intermediate document for consultation and information organization, rather than as a complete archival replacement for the original DXF file.
Make the Final Decision Yourself
Organizing DXF information as JSON makes it easier to provide generative AI with structured information such as text, coordinates, layers, and entity types.
Compared with showing the AI only a PDF image of the drawing, this may help it identify revision points and possible inconsistencies more systematically.
However, generative AI does not necessarily understand the design intent, internal company rules, manufacturing requirements, or installation conditions behind a drawing.
Information may also be lost during conversion, and the AI may produce incorrect interpretations or overlook important details.
Any advice provided by generative AI should therefore be treated as supporting information for identifying areas that require further review.
Always compare the results with the original DXF file, PDF drawings, specifications, and other related documents.
The final decision regarding a drawing or specification must be made by the CAD operator, designer, engineer, or other responsible professional.