CN110209630B - DXF file information processing method and device, computer equipment and storage medium - Google Patents

DXF file information processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110209630B
CN110209630B CN201910337062.4A CN201910337062A CN110209630B CN 110209630 B CN110209630 B CN 110209630B CN 201910337062 A CN201910337062 A CN 201910337062A CN 110209630 B CN110209630 B CN 110209630B
Authority
CN
China
Prior art keywords
information
primitive
area
data
primitive information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910337062.4A
Other languages
Chinese (zh)
Other versions
CN110209630A (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Ruizhu Intelligent Technology Co ltd
Guangdong Ruizhu Residential Technology Co ltd
Original Assignee
Guangdong Remac Equipment Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Remac Equipment Information Technology Co Ltd filed Critical Guangdong Remac Equipment Information Technology Co Ltd
Priority to CN201910337062.4A priority Critical patent/CN110209630B/en
Publication of CN110209630A publication Critical patent/CN110209630A/en
Application granted granted Critical
Publication of CN110209630B publication Critical patent/CN110209630B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures

Abstract

The application provides a DXF file information processing method, device, computer equipment and storage medium, through picture frame piece attribute information and the size data of predetermineeing the picture frame piece, divide the primitive information in the DXF file that reads into a plurality of regions, can use the region to extract the primitive information of complicated drawing data as the unit, improve the reading efficiency of primitive information, and, carry out classification processing with the primitive information, can reduce the error rate of data reading, in addition, still carried out further processing of collecting to the classification data that obtains, in conclusion, according to this scheme has carried out regional division, classification processing and collection processing to the primitive information, so can realize carrying out effectual information-based management to the information in the drawing.

Description

DXF file information processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer data processing technologies, and in particular, to a DXF file information processing method, apparatus, computer device, and storage medium.
Background
The manufacturing industry and the construction industry are industries with more drawing output, construction process design drawings (DXF format) contain a large amount of construction member information, and relate to reinforced concrete floor slabs, shear walls, prefabricated superposed beams, prefabricated columns, prefabricated external hanging walls and the like, the difficulty of drawing arrangement is increased by huge drawing information data, and an efficient and reasonable information arrangement tool or technology is necessary due to the heavy work of arranging and filing primitive information.
Therefore, a scheme that the architectural process design drawing (DXF format) can be exported in a form through analysis and processing of a software system appears, but the technical scheme can only process reading of a drawing form in a simple DXF format, and when a complicated drawing including a plurality of forms is encountered, the exported DXF drawing form data is easily crossed and disordered, so that effective information management cannot be performed on information in the drawing.
Disclosure of Invention
Therefore, it is necessary to provide a DXF file information processing method, apparatus, computer device, and storage medium for solving the problem that the existing DXF format drawing processing scheme cannot perform effective information management on information in a drawing.
A DXF file information processing method comprises the following steps:
when receiving a DXF file, reading drawing information of the DXF file, wherein the drawing information comprises attribute information and graphic element information of a graphic frame block, and the graphic element information comprises a plurality of tables;
dividing the primitive information into a plurality of areas according to the attribute information of the picture frame block and size data of a preset picture frame block;
circularly reading the primitive information of each area, and classifying the primitive information of each area to obtain classified data;
and collecting the data belonging to the same table in the classified data, and keeping the sequence among the data to obtain the integrated primitive information of each area.
In one embodiment, dividing the meta information into a plurality of areas according to the attribute information of the frame block includes:
counting the number of the picture frame blocks;
obtaining a coordinate value of a reference origin in the attribute information of the frame block, wherein the reference origin is an offset origin of coordinates relative to the world coordinate system origin of the frame block;
dividing the primitive information into a plurality of areas according to the coordinate value of the reference origin and the preset picture frame block size data, and adding marks to each divided area, wherein the number of the areas is equal to the number of the picture frame blocks obtained through statistics.
In one embodiment, cyclically reading the primitive information of each zone, and classifying the primitive information of each zone includes:
circularly reading the primitive information of each area by adopting a recursive circular algorithm;
obtaining coordinate values of each graphic element information;
and archiving and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin and the preset picture frame block size data to obtain classified data, wherein the classified data carries the mark of the area to which the classified data belongs.
In one embodiment, the archiving and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin, and the preset block size data comprises:
calculating the difference value between the coordinate value of each primitive information and the coordinate value of the reference origin;
comparing the size relation between the difference value and preset picture frame block size data;
and according to the size relation, filing and classifying the primitive information of each area according to a preset drawing specification standard.
In one embodiment, the method further comprises the following steps:
when reading that a certain area contains a plurality of tables, adding a mark index for the primitive information of the area, wherein the mark index is used for distinguishing the primitive information of other areas.
In one embodiment, after obtaining the integrated primitive information of each region, the method further includes:
storing the integrated primitive information of each area in a text file mode;
or the like, or, alternatively,
and storing the integrated primitive information of each area to a preset database in a table form.
In one embodiment, after obtaining the integrated primitive information of each region, the method further includes:
and displaying the integrated primitive information of each area.
A DXF file information processing apparatus, comprising:
the data reading module is used for reading drawing information of the DXF file when the DXF file is received, wherein the drawing information comprises attribute information and graphic element information of a graphic frame block, and the graphic element information comprises a plurality of tables;
the area dividing module is used for dividing the primitive information into a plurality of areas according to the attribute information of the picture frame blocks and size data of the preset picture frame blocks;
the classification processing module is used for circularly reading the primitive information of each area and classifying the primitive information of each area to obtain classification data;
and the data integration module is used for collecting the data belonging to the same table in the classified data and reserving the sequence among the data to obtain the integrated primitive information of each area.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
when receiving a DXF file, reading drawing information of the DXF file, wherein the drawing information comprises attribute information and graphic element information of a graphic frame block, and the graphic element information comprises a plurality of tables;
dividing the primitive information into a plurality of areas according to the attribute information of the picture frame block and size data of a preset picture frame block;
circularly reading the primitive information of each area, and classifying the primitive information of each area to obtain classified data;
and collecting the data belonging to the same table in the classified data, and keeping the sequence among the data to obtain the integrated primitive information of each area.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
when receiving a DXF file, reading drawing information of the DXF file, wherein the drawing information comprises attribute information and graphic element information of a graphic frame block, and the graphic element information comprises a plurality of tables;
dividing the primitive information into a plurality of areas according to the attribute information of the picture frame block and size data of a preset picture frame block;
circularly reading the primitive information of each area, and classifying the primitive information of each area to obtain classified data;
and collecting the data belonging to the same table in the classified data, and keeping the sequence among the data to obtain the integrated primitive information of each area.
According to the DXF file information processing method, the device, the computer equipment and the storage medium, the read primitive information in the DXF file is divided into a plurality of areas through the attribute information of the picture frame blocks and the size data of the preset picture frame blocks, the primitive information of the complex drawing data can be extracted by taking the areas as units, the reading efficiency of the primitive information is improved, the primitive information is classified, the error rate of data reading can be reduced, in addition, the obtained classified data is further subjected to collection processing, and in conclusion, the area division, the classification processing and the collection processing are performed on the primitive information based on the scheme, so that the effective information management on the information in the drawing can be realized.
Drawings
FIG. 1 is a diagram of an application environment for a method for processing DXF file information in one embodiment;
FIG. 2 is a flowchart illustrating a method for processing DXF file information according to an embodiment;
FIG. 3 is a diagram illustrating a detailed flowchart of a DXF file information processing method according to another embodiment;
FIG. 4 is a schematic drawing frame diagram of one embodiment;
FIG. 5 is a schematic diagram of the coordinates of a single region in one embodiment;
FIG. 6 is a screenshot of a text file exported in one embodiment;
FIG. 7 is a block diagram showing the structure of a DXF file information processing apparatus according to an embodiment;
FIG. 8 is a block diagram showing the construction of a DXF file information processing apparatus according to another embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for processing the DXF file information can be applied to an application environment diagram shown in figure 1, a user classifies and divides a plurality of graphic elements in a DXF file of a finished building process drawing, then uploads the DXF drawing after the classification processing to a terminal, the terminal can be a client terminal and a service terminal, the terminal is used for reading the graphic element information of the DXF drawing, when the terminal receives the DXF file, the terminal starts to read the drawing information of the DXF file (the drawing information comprises the attribute information and the graphic element information of a frame block, and the graphic element information comprises a plurality of tables), then the graphic element information is divided into a plurality of areas according to the attribute information of the frame block and the size data of a preset frame block, then the graphic element information of each area is read in a circulating mode, the graphic element information of each area is classified to obtain classification data, and further, the data belonging to the same table in the classification data are collected, and preserving the sequence among the data to obtain the integrated primitive information of each area.
The client terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices; the service terminal 104 may be implemented as an independent service terminal or a service terminal cluster composed of a plurality of service terminals. Wherein the data information can be transmitted between the client terminal and the service terminal.
In one embodiment, as shown in fig. 2, a DXF file information processing method is provided, which is described by taking an example that the method is applied to a service terminal, and includes the following steps:
step S200, when the DXF file is received, drawing information of the DXF file is read, wherein the drawing information comprises attribute information and graphic element information of the graphic block, and the graphic element information comprises a plurality of tables.
The DXF file is an AutoCAD (Drawing Exchange Format or Drawing Exchange Format) Drawing Exchange file, and a complete DXF file structure comprises six file segments and an end of Edge (EOF) flag. The six file segments include: the head segment, the class segment, the table segment, the block segment, the entity segment and the object segment respectively store the version number and the system variable, the class information of the system definition, the system table information, the graphic block information and all the non-geometric entity information of other graphic files (the file segments are defined in the drawing design stage). In this embodiment, the primitive information includes a text, multiple texts, a point, a straight line segment, a curve, multiple line segments, an arc, an elliptic arc, an ellipse, a circle, a B-spline curve, a combined block of the primitive, a layer attribute, and a table composed of multiple straight line segments and multiple pieces of text information, where the frame block refers to a rectangular box marked in the DXF file by a user, and reading the drawing information of the DXF file refers to caching all the primitive information of the drawing, including information such as a position coordinate, a length, a color, a layer, and a name.
In step S400, the primitive information is divided into a plurality of regions according to the attribute information of the frame block and the size data of the preset frame block.
In practical application, a drawing designer classifies a plurality of single drawings in a DXF file, and uses a rectangular box (a drawing block) to divide the primitive information belonging to the same category into the same area, thereby completing area division of all the primitive information. Specifically, the AutoCAD system provides an absolute coordinate system, namely a world coordinate system, coordinates of the world coordinate system cannot be changed, but a drawing designer can define a plurality of coordinates according to the world coordinate system, so that the drawing design is facilitated. In this embodiment, a reference area of the DXF drawing is determined by using a relative coordinate system, and then a range area is set according to a reference point of a frame block (a frame block of an area is marked by manual instruction software, that is, a rectangular frame, each frame is marked, and the size of each defined rectangular frame is the same), so that area division is completed for all primitive information of the DXF file. It will be appreciated that in other embodiments, the frame blocks may or may not be the same size.
And step S600, circularly reading the primitive information of each area, and classifying the primitive information of each area to obtain classified data.
After the area division of the primitive information is completed, firstly, the primitive information of a single area can be circularly read by adopting a recursive loop algorithm until the primitive information of all the areas is completely read. And then obtaining the coordinates of the primitive information of the single area, analyzing the primitive information of each area according to the coordinates of the primitive information, and classifying the primitive information of each area according to the coordinates of the primitive information and the reference origin coordinates of the frame block where the primitive information is located to obtain classified data. The classification processing includes marking the picture frame blocks corresponding to the read graphic element information. It is understood that in other embodiments, the data reading mode can be other data extraction algorithms.
Step S800, collecting the data belonging to the same table in the classification data, and keeping the sequence among the data to obtain the integrated primitive information of each area.
In practical application, each table in the primitive information comprises attributes of header names, after the primitive information of all the areas is classified, the primitive information is grouped according to the attributes of the header names, then the data with the same header names are collected together, and the original sequence among the data in the same table is kept, so that the integrated primitive information of each area is obtained after the data in all the tables are extracted.
According to the DXF file information processing method, the read primitive information in the DXF file is divided into a plurality of areas through the attribute information of the picture frame blocks and the size data of the preset picture frame blocks, the primitive information of the complex drawing data can be extracted by taking the areas as units, the reading efficiency of the primitive information is improved, the primitive information is classified, the error rate of data reading can be reduced, in addition, the obtained classified data is further subjected to collection processing, in conclusion, the area division, the classification processing and the collection processing are carried out on the primitive information based on the scheme, and therefore effective information management on the information in the drawing can be achieved.
As shown in fig. 3, in one embodiment, dividing the meta information into a plurality of areas according to the attribute information of the frame block includes: step S420, counting the number of the frame blocks, and acquiring coordinate values of a reference origin in the attribute information of the frame blocks, wherein the reference origin is an offset coordinate origin relative to the world coordinate system origin of the frame blocks; dividing the primitive information into a plurality of areas according to the coordinate value of the reference origin and the preset picture frame block size data, and adding marks to each divided area, wherein the number of the areas is equal to the number of the picture frame blocks obtained through statistics.
The attribute information of the frame block includes coordinate values of a reference origin of the frame block, and the size data of the frame block is set in advance as known data. Since the Area of the DXF drawing to be read is determined by the number of frame blocks (divided manually) inside the drawing itself, when the content of the DXF drawing is read, the number of frame blocks is counted by itself, then coordinate values of the reference origin of each frame block are obtained, as shown in the drawing frame diagram of fig. 4, the reference origin is an offset coordinate origin from the world coordinate system origin, the reference point is located at the lower left corner of each frame block, then all primitive information is divided into a plurality of areas according to the preset size data of the frame block, i.e., the size of the length and the width, and the size of the reference origin and the size of the length and the width of the frame block, and marks are added to each Area while dividing the Area, for example, the marks may be Area01, Area02, Area03 …, and the number of the divided areas is equal to the number of the counted frame blocks. It is understood that the manner in which the regions are marked is merely an example, and in other embodiments, the manner in which the regions are marked may be other manners. In the embodiment, a drawing designer divides the area by designing the relative coordinate system through the world coordinate system, so that the division of the primitive data is facilitated.
In one embodiment, cyclically reading the primitive information of each zone, and classifying the primitive information of each zone includes: and step S620, circularly reading the primitive information of each area by adopting a recursive circular algorithm, obtaining the coordinate value of each primitive information, filing and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin and the preset data of the sizes of the picture frames to obtain classified data, wherein the classified data carries the mark of the area to which the classified data belongs.
After the primitive information is divided into regions, the primitive information in each region is also disordered, so that the primitive information in each region needs to be classified and archived. Specifically, firstly, taking a single area as a unit, sequentially reading the content of the single area by adopting a recursive cyclic algorithm, then obtaining data information for circularly sorting the areas, namely obtaining coordinate values of primitive information in the areas, filing and classifying each primitive information in the same area according to the coordinate values of the primitive information, the coordinate values of a reference origin of a frame block and preset size data of the frame block, filing and classifying the primitive information in the area, and filing the primitive information in the area to obtain classified data, in the classifying process, identifying a mark of each read area (frame block), and adding an area mark to each primitive information in the area for marking the area from which the data of the primitive information comes. In this embodiment, by filing and classifying the primitive information in each area, it is convenient for the follow-up manual problem troubleshooting and data checking.
In one embodiment, the method further comprises the following steps: when reading that a certain area contains a plurality of tables, adding a mark index for the primitive information of the area, wherein the mark index is used for distinguishing the primitive information of other areas.
After the division of the areas of the primitive information is completed, the primitive information content of a single area is much simpler compared with the whole drawing, the primitive information of each area can be sequentially read by adopting a recursive loop algorithm, in the process of circularly reading the primitive information of each area of the area, when a plurality of table contents are still nested in a certain area, the area is further divided by adopting a recursive mode, and an index mark is added to the data in the area. In this embodiment, the recursive loop algorithm may also be considered to read the contents of multiple tables. By adding a mark index to table data of an area including a plurality of tables, data in the table can be distinguished from primitive information of other areas.
In one embodiment, the archiving and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin, and the preset block size data comprises: and calculating the difference value between the coordinate value of each primitive information and the coordinate value of the reference origin, comparing the size relation between the difference value and the preset drawing frame block size data, and filing and classifying the primitive information of each area according to the size relation and the preset drawing specification standard.
In this embodiment, the classification and archiving of the primitive information in each area is performed according to the difference range between the coordinate value of the primitive information itself and the reference origin of the frame block. Specifically, as in the previous embodiment, the drawing area of the architectural art drawing is scribedThe world coordinates of the frame blocks of the drawing content are taken as reference, the reference origin is located at the lower left corner of the frame blocks, as shown in a single-region coordinate schematic diagram shown in fig. 5, the frame blocks are rectangular regions in a two-dimensional coordinate system shown in fig. 5, the difference value between the coordinate value of each primitive information in the rectangular regions and the coordinate value of the reference origin is calculated, the size relationship between the difference value and the preset frame block size data is compared, and the primitive information of each region is filed and classified according to the preset drawing specification standard according to the size relationship. For example, the Area01 is set to have a width M, a height N, and the coordinates of the primitive information A in the Area01 are set to be (X)1,Y1) Reference origin O of picture frame block1Is (X)0,Y0) Then the primitive information A and the frame block reference origin O1The coordinate difference of (a) is: Δ X ═ X1-X0、ΔY=Y1-Y0If Δ X is less than or equal to M and Δ Y is less than or equal to N, determining that the primitive information a is located in the Area01, and dividing the primitive information a into the Area01, thereby completing classification and archiving of all primitive information, and simultaneously classifying and archiving the primitive information according to a preset drawing specification standard, for example, labeling data to two bits after decimal point. In this embodiment, the classification filing mode may be to extract all the integrated classification data into a form to obtain DXF drawing form data. It can be understood that, in other embodiments, after the area division is completed, the primitive information is integrated according to the difference between the primitive information coordinates and the reference origin, so that the method is simple, convenient and effective, and the error rate in the later data export process can be reduced.
As shown in fig. 3, in one embodiment, after obtaining the primitive information of each integrated area, the method further includes: and step S900, displaying the integrated primitive information of each area.
As described in the foregoing embodiment, after obtaining the integrated primitive information, the integrated primitive information of each area is displayed, specifically, the displaying of the integrated primitive information of each area is represented by sending a display instruction to the client terminal 102 at the service terminal 104, and after receiving the display instruction, the client terminal 102 displays the DXF drawing table data obtained after integrating the primitive information on the screen, where the table data may refer to fig. 6, where fig. 6 shows a part of the content of the table data obtained after reading the frame content of a single area, and a user can view and check the integrated primitive data on the display interface. In this embodiment, by displaying the integrated primitive information of each region, a user can check and check the primitive information conveniently.
As shown in fig. 3, in one embodiment, after obtaining the primitive information of each integrated area, the method further includes: step S950, storing the integrated primitive information of each region in a text file, or storing the integrated primitive information of each region in a table form to a preset database.
In this embodiment, the text file is a CSV (Comma-Separated Values) file, which is sometimes also referred to as a character separation value because the separation character may not be a Comma, and the file stores table data (numbers and text) in a plain text form. After the primitive information of each area is integrated, the integrated drawing data can be exported for use in order to facilitate subsequent use of the integrated drawing data. In this embodiment, the integrated primitive information is saved by using a text file, or the integrated primitive information is saved in a preset database, such as MySQL, Oracle or other databases. In this embodiment, the text file is a CSV (Comma-Separated Values) file, which is sometimes also referred to as a character separation value because the separation character may not be a Comma, and the file stores table data (numbers and text) in a plain text form. In the embodiment, the integrated primitive information is stored persistently in a file CSV file or database mode, so that the data of the integrated drawing can be checked and used anytime and anywhere.
It should be understood that although the steps in the flowcharts of fig. 2 and 3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2 and 3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 7, there is provided a DXF file information processing apparatus including: a data reading module 710, a region dividing module 720, a classification processing module 730 and a data integration module 740, wherein:
the data reading module 710 is configured to, when a DXF file is received, read drawing information of the DXF file, where the drawing information includes attribute information and primitive information of a frame block, and the primitive information includes multiple tables.
The region dividing module 720 is configured to divide the primitive information into a plurality of regions according to the attribute information of the frame block and size data of a preset frame block.
And the classification processing module 730 is configured to cyclically read the primitive information of each region, and perform classification processing on the primitive information of each region to obtain classification data.
The data integration module 740 is configured to collect data belonging to the same table in the classified data, and retain the order among the data, so as to obtain primitive information of each integrated region.
In one embodiment, the region dividing module 720 is further configured to count the number of frame blocks, obtain a coordinate value of a reference origin in the attribute information of the frame block, where the reference origin is an offset coordinate origin from a world coordinate system origin of the frame block, divide the meta information into a plurality of regions according to the coordinate value of the reference origin and preset frame block size data, and add a mark to each of the divided regions, where the number of the regions is equal to the number of the counted frame blocks.
In one embodiment, the classification processing module 730 is further configured to cyclically read the primitive information of each area by using a recursive cyclic algorithm, obtain coordinate values of each primitive information, and perform filing classification on the primitive information of each area according to the coordinate values of each primitive information, the coordinate values of the reference origin, and preset frame block size data to obtain classification data, where the classification data carries a mark of the area to which the classification data belongs.
In one embodiment, the classification processing module 730 is further configured to calculate a difference between the coordinate value of each primitive and the coordinate value of the reference origin, compare the size relationship between the difference and the predetermined block size data of the frame, and archive and classify the primitive information of each area according to a predetermined drawing specification standard according to the size relationship.
In one embodiment, the classification processing module 730 is further configured to, when a certain area is read to contain multiple tables, add a mark index to the primitive information of the area, where the mark index is used to distinguish the primitive information of other areas.
In one embodiment, the DXF file information processing apparatus further includes a data display module 750, configured to display the integrated primitive information of each region.
In one embodiment, the DXF file information processing apparatus further includes a data saving module 760, configured to save the integrated primitive information of each region in a text file, or save the integrated primitive information of each region in a table form to a preset database.
Specific limitations regarding DXF file information processing apparatus may be found in the above limitations regarding DXF file information processing methods, which are not described in detail herein. The respective modules in the DXF file information processing apparatus described above may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, and the computer device may be a service terminal (server), and the internal structure diagram thereof may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing drawing data and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a DXF file information processing method.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: when receiving a DXF file, reading drawing information of the DXF file, wherein the drawing information comprises attribute information and primitive information of a frame block, the primitive information comprises a plurality of tables, dividing the primitive information into a plurality of areas according to the attribute information of the frame block and size data of a preset frame block, circularly reading the primitive information of each area, classifying the primitive information of each area to obtain classified data, collecting data belonging to the same table in the classified data, and reserving the sequence among the data to obtain the integrated primitive information of each area.
In one embodiment, the processor, when executing the computer program, further performs the steps of: counting the number of the picture frame blocks, obtaining a coordinate value of a reference origin in attribute information of the picture frame blocks, wherein the reference origin is an offset coordinate origin relative to a world coordinate system origin of the picture frame blocks, dividing the picture element information into a plurality of regions according to the coordinate value of the reference origin and preset picture frame block size data, adding marks to each divided region, and the number of the regions is equal to the number of the picture frame blocks obtained through counting.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and circularly reading the primitive information of each area by adopting a recursive circular algorithm, acquiring the coordinate value of each primitive information, and filing and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin and the preset picture frame block size data to obtain classified data, wherein the classified data carries the mark of the area to which the classified data belongs.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and calculating the difference value between the coordinate value of each primitive information and the coordinate value of the reference origin, comparing the size relation between the difference value and the preset drawing frame block size data, and filing and classifying the primitive information of each area according to the size relation and the preset drawing specification standard.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when reading that a certain area contains a plurality of tables, adding a mark index for the primitive information of the area, wherein the mark index is used for distinguishing the primitive information of other areas.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and storing the integrated primitive information of each area in a text file mode, or storing the integrated primitive information of each area in a preset database in a table mode.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and displaying the integrated primitive information of each area.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor performs the steps of: when receiving a DXF file, reading drawing information of the DXF file, wherein the drawing information comprises attribute information and primitive information of a frame block, the primitive information comprises a plurality of tables, dividing the primitive information into a plurality of areas according to the attribute information of the frame block and size data of a preset frame block, circularly reading the primitive information of each area, classifying the primitive information of each area to obtain classified data, collecting data belonging to the same table in the classified data, and reserving the sequence among the data to obtain the integrated primitive information of each area.
In one embodiment, the computer program when executed by the processor further performs the steps of: counting the number of the picture frame blocks, obtaining a coordinate value of a reference origin in attribute information of the picture frame blocks, wherein the reference origin is an offset coordinate origin relative to a world coordinate system origin of the picture frame blocks, dividing the picture element information into a plurality of regions according to the coordinate value of the reference origin and preset picture frame block size data, adding marks to each divided region, and the number of the regions is equal to the number of the picture frame blocks obtained through counting.
In one embodiment, the computer program when executed by the processor further performs the steps of: and circularly reading the primitive information of each area by adopting a recursive circular algorithm, acquiring the coordinate value of each primitive information, and filing and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin and the preset picture frame block size data to obtain classified data, wherein the classified data carries the mark of the area to which the classified data belongs.
In one embodiment, the computer program when executed by the processor further performs the steps of: and calculating the difference value between the coordinate value of each primitive information and the coordinate value of the reference origin, comparing the size relation between the difference value and the preset drawing frame block size data, and filing and classifying the primitive information of each area according to the size relation and the preset drawing specification standard.
In one embodiment, the computer program when executed by the processor further performs the steps of: when reading that a certain area contains a plurality of tables, adding a mark index for the primitive information of the area, wherein the mark index is used for distinguishing the primitive information of other areas.
In one embodiment, the computer program when executed by the processor further performs the steps of: and storing the integrated primitive information of each area in a text file mode, or storing the integrated primitive information of each area in a preset database in a table mode.
In one embodiment, the computer program when executed by the processor further performs the steps of: and displaying the integrated primitive information of each area.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A DXF file information processing method, comprising:
when a DXF file is received, reading drawing information of the DXF file, wherein the drawing information comprises attribute information and graphic element information of a graphic frame block, and the graphic element information comprises a plurality of tables;
dividing the primitive information into a plurality of areas according to the attribute information of the primitive block and size data of a preset primitive block;
circularly reading the primitive information of each area, and classifying the primitive information of each area to obtain classified data;
collecting the data belonging to the same table in the classified data, and reserving the sequence among the data to obtain the integrated primitive information of each area;
the dividing the primitive information into a plurality of regions according to the attribute information of the primitive block includes:
counting the number of the picture frame blocks;
obtaining a coordinate value of a reference origin in the attribute information of the picture frame block, wherein the reference origin is an offset coordinate origin relative to a world coordinate system origin of the picture frame block;
and dividing the primitive information into a plurality of areas according to the coordinate value of the reference origin and the preset drawing frame block size data, and adding a mark to each divided area, wherein the number of the areas is equal to the number of the drawing frame blocks obtained through statistics.
2. The DXF file information processing method of claim 1, wherein drawing information of the DXF file includes position coordinates, length, color, layer, and name.
3. The DXF file information processing method of claim 2, wherein the cyclically reading the primitive information of each of the regions and classifying the primitive information of each of the regions comprises:
circularly reading the primitive information of each area by adopting a recursive circular algorithm;
obtaining coordinate values of each graphic element information;
and archiving and classifying the primitive information of each area according to the coordinate value of each primitive information, the coordinate value of the reference origin and the preset drawing frame block size data to obtain classified data, wherein the classified data carries the mark of the area to which the classified data belongs.
4. The DXF file processing method of claim 3, wherein the archiving and classifying the primitive information of each region according to the coordinate values of the primitive information, the coordinate value of the origin of reference, and the predetermined block size data comprises:
calculating the difference value between the coordinate value of each primitive information and the coordinate value of the reference origin;
comparing the size relationship between the difference value and the preset drawing frame block size data;
and according to the size relation, filing and classifying the primitive information of each area according to a preset drawing specification standard.
5. The DXF file information processing method of claim 1, further comprising:
when reading that a certain area contains a plurality of tables, adding a mark index for the primitive information of the area, wherein the mark index is used for distinguishing the primitive information of other areas.
6. The DXF file information processing method of any of claims 1-5, wherein after obtaining the primitive information for each of the regions after integration, the method further comprises:
storing the integrated primitive information of each area in a text file mode;
or the like, or, alternatively,
and storing the integrated primitive information of each area to a preset database in a table form.
7. The DXF file information processing method of any of claims 1-5, wherein after obtaining the primitive information for each of the regions after integration, the method further comprises:
and displaying the integrated graphic element information of each area.
8. An apparatus for processing DXF file information, the apparatus comprising:
the data reading module is used for reading drawing information of the DXF file when the DXF file is received, wherein the drawing information comprises attribute information and graphic element information of a graphic frame block, and the graphic element information comprises a plurality of tables;
the area dividing module is used for dividing the primitive information into a plurality of areas according to the attribute information of the primitive block and size data of a preset primitive block;
the classification processing module is used for circularly reading the primitive information of each area and classifying the primitive information of each area to obtain classification data;
the data integration module is used for collecting the data belonging to the same table in the classified data and reserving the sequence among the data to obtain the integrated primitive information of each area;
the region division module is further configured to: counting the number of the picture frame blocks; obtaining a coordinate value of a reference origin in the attribute information of the picture frame block, wherein the reference origin is an offset coordinate origin relative to a world coordinate system origin of the picture frame block; and dividing the primitive information into a plurality of areas according to the coordinate value of the reference origin and the preset drawing frame block size data, and adding a mark to each divided area, wherein the number of the areas is equal to the number of the drawing frame blocks obtained through statistics.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201910337062.4A 2019-04-25 2019-04-25 DXF file information processing method and device, computer equipment and storage medium Active CN110209630B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910337062.4A CN110209630B (en) 2019-04-25 2019-04-25 DXF file information processing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910337062.4A CN110209630B (en) 2019-04-25 2019-04-25 DXF file information processing method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110209630A CN110209630A (en) 2019-09-06
CN110209630B true CN110209630B (en) 2021-06-22

Family

ID=67786350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910337062.4A Active CN110209630B (en) 2019-04-25 2019-04-25 DXF file information processing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110209630B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112540963A (en) * 2019-09-20 2021-03-23 久瓴(上海)智能科技有限公司 Information processing method and device, computer equipment and readable storage medium
CN111144114B (en) * 2019-12-19 2023-07-18 广联达科技股份有限公司 Text recognition method and device
CN111460204B (en) * 2020-04-01 2023-05-09 上海建工四建集团有限公司 Sub-graph extraction method and device of electronic engineering drawing, storage medium and terminal
CN115205886A (en) * 2022-07-14 2022-10-18 中交水运规划设计院有限公司 Method and device for extracting borehole stratum information, electronic equipment and storage medium
CN116385253A (en) * 2023-01-06 2023-07-04 格兰菲智能科技有限公司 Primitive drawing method, device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630335A (en) * 2008-07-18 2010-01-20 纬衡浩建科技(深圳)有限公司 Method for comparing similarity and difference between drawings
CN103077496A (en) * 2013-02-18 2013-05-01 天津市电力公司 Automatic bridging graphics processing method for power system circuit
CN107742017A (en) * 2017-09-30 2018-02-27 国网江苏省电力公司南京供电公司 A kind of operation of power networks information drawing primitive arrangement methods of exhibiting, system and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9111327B2 (en) * 2011-01-18 2015-08-18 Apple Inc. Transforming graphic objects
CN108460056A (en) * 2017-02-22 2018-08-28 电子科技大学中山学院 Method for converting effective graphic elements of DXF file into JSON data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630335A (en) * 2008-07-18 2010-01-20 纬衡浩建科技(深圳)有限公司 Method for comparing similarity and difference between drawings
CN103077496A (en) * 2013-02-18 2013-05-01 天津市电力公司 Automatic bridging graphics processing method for power system circuit
CN107742017A (en) * 2017-09-30 2018-02-27 国网江苏省电力公司南京供电公司 A kind of operation of power networks information drawing primitive arrangement methods of exhibiting, system and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于三维参数化模型的工程图尺寸自动标注与布局;欧阳世嘉等;《模具工业》;20140215;第17-22页 *

Also Published As

Publication number Publication date
CN110209630A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN110209630B (en) DXF file information processing method and device, computer equipment and storage medium
US20180307948A1 (en) Method and device of constructing decision model, computer device and storage apparatus
CN106909901B (en) Method and device for detecting object from image
WO2021147559A1 (en) Service data quality measurement method, apparatus, computer device, and storage medium
WO2020056914A1 (en) Crowd heat map obtaining method and apparatus, and electronic device and readable storage medium
CN107564077B (en) method and device for drawing road network
WO2022062466A1 (en) Chip product comparison method and apparatus, chip product modeling method and apparatus, and storage medium
CN111858977B (en) Bill information acquisition method, device, computer equipment and storage medium
CN116150288A (en) Network data analysis processing system based on computer
CN114550076A (en) Method, device and equipment for monitoring area abnormal behaviors and storage medium
CN109871743B (en) Text data positioning method and device, storage medium and terminal
CN110688995B (en) Map query processing method, computer-readable storage medium and mobile terminal
CN115471582A (en) Map generation method and device, computer equipment and storage medium
CN111046472B (en) Method, device, computer equipment and storage medium for displaying model component information
CN111400289B (en) Intelligent user classification method, server and storage medium
CN114820870A (en) Nuclear power flow chart auxiliary drawing method and device, computer equipment and storage medium
CN113850265A (en) PDF document analysis method and device, electronic equipment and storage medium
CN110321405B (en) Model matching method, model matching device, computer-readable storage medium and computer equipment
US20140325457A1 (en) Searching of line pattern representations using gestures
CN110764090A (en) Image processing method, image processing device, computer equipment and readable storage medium
CN111339133B (en) Data segmentation method and device, computer equipment and storage medium
CN112329118A (en) Method, device, terminal and storage medium for extracting maximum value in structure calculation graph
CN111695441B (en) Image document processing method, device and computer readable storage medium
CN110688375B (en) Method, apparatus and computer readable storage medium for customer penetration analysis
US20220092759A1 (en) Comparison method and modeling method for chip product, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 528300 Guanglong Industrial Park, Chencun Town, Shunde District, Foshan City, Guangdong Province, No. 6, No. 14 Xingye Road

Patentee after: Guangdong Ruizhu residential technology Co.,Ltd.

Address before: 528300 Guanglong Industrial Park, Chencun Town, Shunde District, Foshan City, Guangdong Province, No. 6, No. 14 Xingye Road

Patentee before: GUANGDONG REMAC EQUIPMENT INFORMATION TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
TR01 Transfer of patent right

Effective date of registration: 20220110

Address after: 528300 No. 1, Peilong Road, longyongkou village, Ronggui street, Shunde District, Foshan City, Guangdong Province

Patentee after: Guangdong Ruizhu residential technology Co.,Ltd.

Patentee after: Guangdong Ruizhu Intelligent Technology Co.,Ltd.

Address before: 528300 Guanglong Industrial Park, Chencun Town, Shunde District, Foshan City, Guangdong Province, No. 6, No. 14 Xingye Road

Patentee before: Guangdong Ruizhu residential technology Co.,Ltd.

TR01 Transfer of patent right