CN105912516A - Method for one-lick extraction of table data from AutoCAD file - Google Patents

Method for one-lick extraction of table data from AutoCAD file Download PDF

Info

Publication number
CN105912516A
CN105912516A CN201610203060.2A CN201610203060A CN105912516A CN 105912516 A CN105912516 A CN 105912516A CN 201610203060 A CN201610203060 A CN 201610203060A CN 105912516 A CN105912516 A CN 105912516A
Authority
CN
China
Prior art keywords
dbtext
coordinate
array
data
file
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.)
Granted
Application number
CN201610203060.2A
Other languages
Chinese (zh)
Other versions
CN105912516B (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.)
NANJING LUCULENT SOFTWARE CO Ltd
Original Assignee
NANJING LUCULENT SOFTWARE 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 NANJING LUCULENT SOFTWARE CO Ltd filed Critical NANJING LUCULENT SOFTWARE CO Ltd
Priority to CN201610203060.2A priority Critical patent/CN105912516B/en
Publication of CN105912516A publication Critical patent/CN105912516A/en
Application granted granted Critical
Publication of CN105912516B publication Critical patent/CN105912516B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Abstract

The invention discloses a method for one-lick extraction of table data from an AutoCAD file.The method comprises following steps: obtaining features of tables from configuration files; establishing data structures of tables; filling table data to a DataGridView control corresponding to original data view; searching for corresponding header DBText objects based on features of table data, determining the range of tables and layout of table cells by calculations and determining line sequences in words of table cells based on Y coordinates of DBText objects; filling table data converted to the DataGridView control corresponding to a preview; and guiding table data converted to an EXCEL file. The method for one-lick extraction of table data from the AutoCAD file is capable of rapidly extracting all table data of the AutoCAD file. Data of tables can be saved as EXCEL tables for further use. The overall operation process is very convenient.

Description

A kind of method of one-touch extraction list data from autocad file
Technical field
The invention discloses a kind of method of one-touch extraction list data from autocad file, relate to computer graphics software Technical field.
Background technology
AutoCAD is a current popular engineering drawing software.A lot of construction parties using AutoCAD software, in foundation While drawing construction, it is also possible to carry out the buying of the goods and materials such as equipment, material according to the requirement of design and owner.To this end, From autocad file, extract corresponding list data, and then data are saved as Microsoft Excel, be also that a kind of new client needs Ask.
AutoCAD has been initially added into form (Table) object from R16, but due to aspects such as use habits, people are still Get used to using by line (Line) and word (DBText) objects draw form.Each object in this form is from logic There is no any contact on, be merely by respective position relationship and define a visual form effect.This form With the difference that the part outside form does not has any essence.Accordingly, it is determined that the scope of form is the most difficult, and then table cannot be determined The information such as the word in the line number of lattice, columns, cell.In order to determine the scope of form, the way of major part software is at present Marked form scope by user hereof or choose the whole objects in form, then by determining the line number of form, columns, unit The information such as the word in lattice.This way is the most feasible, but often operates the data that once can only extract a form.If form Time many, complex operation, easy maloperation.
Summary of the invention
The technical problem to be solved is: for the defect of prior art, it is provided that a kind of one key from Auto cad file Formula extracts the method for list data, can be with the whole list data of rapid extraction Auto cad file.
The present invention solves above-mentioned technical problem by the following technical solutions:
A kind of method of one-touch extraction list data from autocad file, concrete steps include,
Step one, from configuration file, obtain the feature of form, including text and the literary composition of rightmost end column gauge outfit of high order end list head This arrangement, is DBText object 1 by the text definition of high order end list head, is DBText by the text definition of rightmost end column gauge outfit Object 2, DBText object 1 and DBText object 2 forms a DBText object pair;
Step 2, set up the data structure of form;
Step 3, list data is filled up to the DataGridView control corresponding to initial data view;
Step 4, find corresponding gauge outfit DBText object according to the feature of list data, through calculating determine form scope, The layout of cell, then determines the line order of the internal word of cell in the inside of cell according to the Y coordinate of DBText object;
Step 4, will through conversion list data be filled up to the DataGridView control corresponding to preview view;
Step 5, will through conversion list data export as EXCEL file.
As present invention further optimization scheme, described step 1 specifically includes,
In AUTOCAD file, collect object, set up DBText array, horizontal linear object array, vertical line object array;
Filter out whole DBText object 1 and DBText objects 2;
DBText object 1 and DBText object 2 is matched, forms a DBText object pair.
As present invention further optimization scheme, described step 2 specifically includes,
201, based on the position of DBText object 1 and DBText object 2, initial form scope is set up;
202, set up vertical line array and the X-coordinate array of form, find out the vertical line by form scope, often find one Bar vertical line, is just added into vertical line array, and is comprise linear extent and form scope new by form expanded range Scope, if it differs with the X-coordinate of other vertical line in form, just charges to X-coordinate array by the X-coordinate of straight line;
203, set up horizontal linear array and the Y coordinate array of form, find out the horizontal linear by form scope, often find one Bar horizontal linear, is just added into horizontal linear array, and is comprise linear extent and form scope new by form expanded range Scope, if it differs with the Y coordinate of other horizontal linears in form, just charges to Y coordinate array by the Y coordinate of straight line;
204, the position of whole cells of whole form is determined according to X-coordinate array and Y coordinate array, according to DBText pair The position of elephant, charges to DBText object and Y coordinate thereof in the cell of correspondence.
Step 203 is also included as after present invention further optimization scheme, described step 203 ', to X-coordinate array The data of data and Y coordinate array carry out anti-interference process, are ranked up the data of coordinate array, check coordinate and upper one by one The difference of one coordinate, if difference is less than the threshold value set, just deletes this coordinate from array.Wherein, described thresholding Value is 1 millimeter.
The present invention uses above technical scheme compared with prior art, has following technical effect that the method disclosed in the present can With the list data that rapid extraction autocad file is whole.Data in form can be saved as Microsoft Excel, enters The utilization of one step.The operation of whole process is the most convenient.
Accompanying drawing explanation
Fig. 1 is the structural representation of form related data.
Fig. 2 is the schematic flow sheet of the method for the invention.
Detailed description of the invention
Embodiments of the present invention are described below in detail, and the example of described embodiment is shown in the drawings, the most extremely Same or similar label represents same or similar element or has the element of same or like function eventually.Below by ginseng The embodiment examining accompanying drawing description is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Below in conjunction with the accompanying drawings technical scheme is described in further detail:
With the actual mechanical process of user as embodiment, after user clicks on derivation form button, through program analysis and Calculate from AUTOCAD file, identify some forms, and show in form derives forms.Derive the forms of form by 4 Part composition.Top line be drawn into list data after selectable operation.List data can be exported to by user In Excel.Second row is the positional information of the form extracted.The cell of the different rows that Clicks here will show in fourth line Different forms.The third line is the view pattern that form is different.User want to see can select with the form that escape dictionary is converted " pre- Look at " view.User wants that the initial data seeing AUTOCAD can see initial data view.User can also select " contrast " to make Obtain two kinds of views to show simultaneously.
In a particular embodiment, the table features in the user interface of table features is set and refers to the text of high order end list head and the rightest The arrangement of the text of end list head.It is assumed that the text of high order end list head is " sequence number " in a form, rightmost end column gauge outfit Text be " remarks ", then the feature of this form is exactly the arrangement of " sequence number " " remarks ".Hereafter be based on assumed above enter Row introduces the processing procedure of program.
Because the content of the DBText object of AUTOCAD possibly cannot be directly displayed in the control of Windows.So needing to set Put the user interface of form word escape, carry out escape process.
As in figure 2 it is shown, the process extracting list data comprises the steps of
One, from configuration file, obtain the feature of form.Including:
In AUTOCAD file, collect object, set up DBText array, horizontal linear object array, vertical line object array.
Filter out the DBText object of whole sequence number and remarks.
Sequence number DBText object and remarks DBText object are matched.
Two, the data structure of form is set up.Including:
Initial form scope is set up based on the position (Position) of sequence number DBText object and remarks DBText object (Extents3d)。
Set up vertical line array and the X-coordinate array of form.Find out the vertical line by form scope.One is often found to hang down Straight straight line, is just added into vertical line array, and is to comprise linear extent and the new range of form scope by form expanded range. If it differs with the X-coordinate of other vertical line in form, just the X-coordinate of straight line is charged to X-coordinate array.
Set up horizontal linear array and the Y coordinate array of form.Find out the horizontal linear by form scope.Often find Yi Tiaoshui Flat line, is just added into horizontal linear array, is just to comprise linear extent and the new range of form scope by form expanded range. If it differs with the Y coordinate of other horizontal linears in form, just the Y coordinate of straight line is charged to Y coordinate array.
The data of X-coordinate array and the data of Y coordinate array are carried out anti-interference process.The data of coordinate array are ranked up. Check coordinate and the difference of a upper coordinate one by one, if difference is less than thresholding (assuming it is 1 millimeter), just by this coordinate from array Middle deletion.
The position of whole cells of whole form is may determine that according to X-coordinate array and Y coordinate array.According to DBText object Position, DBText and Y coordinate thereof are charged to correspondence cell in.
Three, form extracts process is that the feature according to form finds corresponding gauge outfit DBText pair, as it is shown in figure 1, through calculating Progressively determine the layout of the scope of form, cell.In the inside of cell then determines cell according to the Y coordinate of DBText The line order of portion's word.
Four, list data is filled up to the DataGridView control corresponding to initial data view, will fill out through the data of conversion Write the DataGridView control corresponding to preview view.
Five, user is optional is submitted to list data other system or exports as EXCEL file.
Above in conjunction with accompanying drawing, embodiments of the present invention are explained in detail, but the present invention are not limited to above-mentioned embodiment, In the ken that those of ordinary skill in the art are possessed, it is also possible to make various on the premise of without departing from present inventive concept Change.The above, be only presently preferred embodiments of the present invention, and the present invention not makees any pro forma restriction, although The present invention is disclosed above with preferred embodiment, but is not limited to the present invention, any those skilled in the art, In the range of without departing from technical solution of the present invention, when the technology contents of available the disclosure above makes a little change or is modified to equivalent The Equivalent embodiments of change, as long as being without departing from technical solution of the present invention content, according to the technical spirit of the present invention, in the present invention Spirit and principle within, any simple amendment that above example is made, equivalent and improvement etc., all still fall within this Within the protection domain of inventive technique scheme.

Claims (5)

1. the method for one-touch extraction list data from autocad file, it is characterised in that: concrete steps include,
Step one, from configuration file, obtain the feature of form, including text and the literary composition of rightmost end column gauge outfit of high order end list head This arrangement, is DBText object 1 by the text definition of high order end list head, is DBText by the text definition of rightmost end column gauge outfit Object 2, DBText object 1 and DBText object 2 forms a DBText object pair;
Step 2, set up the data structure of form;
Step 3, list data is filled up to the DataGridView control corresponding to initial data view;
Step 4, find corresponding gauge outfit DBText object according to the feature of list data, through calculating determine form scope, The layout of cell, then determines the line order of the internal word of cell in the inside of cell according to the Y coordinate of DBText object;
Step 4, will through conversion list data be filled up to the DataGridView control corresponding to preview view;
Step 5, will through conversion list data export as EXCEL file.
A kind of method of one-touch extraction list data from autocad file, it is characterised in that: institute State step 1 to specifically include,
In AUTOCAD file, collect object, set up DBText array, horizontal linear object array, vertical line object array;
Filter out whole DBText object 1 and DBText objects 2;
DBText object 1 and DBText object 2 is matched, forms a DBText object pair.
A kind of method of one-touch extraction list data from autocad file, it is characterised in that: Described step 2 specifically includes,
201, based on the position of DBText object 1 and DBText object 2, initial form scope is set up;
202, set up vertical line array and the X-coordinate array of form, find out the vertical line by form scope, often find one Bar vertical line, is just added into vertical line array, and is comprise linear extent and form scope new by form expanded range Scope, if it differs with the X-coordinate of other vertical line in form, just charges to X-coordinate array by the X-coordinate of straight line;
203, set up horizontal linear array and the Y coordinate array of form, find out the horizontal linear by form scope, often find one Bar horizontal linear, is just added into horizontal linear array, and is comprise linear extent and form scope new by form expanded range Scope, if it differs with the Y coordinate of other horizontal linears in form, just charges to Y coordinate array by the Y coordinate of straight line;
204, the position of whole cells of whole form is determined according to X-coordinate array and Y coordinate array, according to DBText pair The position of elephant, charges to DBText object and Y coordinate thereof in the cell of correspondence.
A kind of method of one-touch extraction list data from autocad file, it is characterised in that: institute Step 203 is also included after stating step 203 ', the data of X-coordinate array and the data of Y coordinate array are carried out anti-interference place The data of coordinate array are ranked up by reason, check coordinate and the difference of a upper coordinate one by one, if difference is less than setting Threshold value, just deletes this coordinate from array.
A kind of method of one-touch extraction list data from autocad file, it is characterised in that: institute Stating threshold value is 1 millimeter.
CN201610203060.2A 2016-04-01 2016-04-01 A method of the one-touch extraction list data from autocad file Active CN105912516B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610203060.2A CN105912516B (en) 2016-04-01 2016-04-01 A method of the one-touch extraction list data from autocad file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610203060.2A CN105912516B (en) 2016-04-01 2016-04-01 A method of the one-touch extraction list data from autocad file

Publications (2)

Publication Number Publication Date
CN105912516A true CN105912516A (en) 2016-08-31
CN105912516B CN105912516B (en) 2019-02-05

Family

ID=56744475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610203060.2A Active CN105912516B (en) 2016-04-01 2016-04-01 A method of the one-touch extraction list data from autocad file

Country Status (1)

Country Link
CN (1) CN105912516B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763382A (en) * 2018-05-18 2018-11-06 中铁山桥集团有限公司 A method of the chart content in CAD program is imported into Excel programs
CN109062921A (en) * 2018-05-31 2018-12-21 武昌船舶重工集团有限公司 A kind of method and system for extracting ship pallet control information
CN109933765A (en) * 2019-03-12 2019-06-25 中冶焦耐(大连)工程技术有限公司 A method of Excel table content is extracted to CAD table
CN110096783A (en) * 2019-04-25 2019-08-06 西门子电站自动化有限公司 The method that slave connection figure based on AutoCAD extracts connection data
CN111985195A (en) * 2020-08-18 2020-11-24 上海外高桥造船有限公司 Text-based AUTOCAD table data reading method
CN112307725A (en) * 2020-10-30 2021-02-02 天津光电通信技术有限公司 Method for adding table information on two-dimensional drawing interface
CN112380826A (en) * 2020-11-12 2021-02-19 中国农业银行股份有限公司佛山分行 Formatted electronic form generation method based on text file

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976232A (en) * 2010-09-19 2011-02-16 深圳市万兴软件有限公司 Method for identifying data form in document and device thereof
CN102722475A (en) * 2012-05-09 2012-10-10 深圳市万兴软件有限公司 Method for converting form in portable document format (PDF) document into Excel form
CN103377177A (en) * 2012-04-27 2013-10-30 北大方正集团有限公司 Method and device for identifying forms in digital format files
CN104063364A (en) * 2013-03-19 2014-09-24 福建福昕软件开发股份有限公司北京分公司 PDF document recognition method
CN104516867A (en) * 2013-09-30 2015-04-15 北大方正集团有限公司 Table reordering method and table reordering system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976232A (en) * 2010-09-19 2011-02-16 深圳市万兴软件有限公司 Method for identifying data form in document and device thereof
CN103377177A (en) * 2012-04-27 2013-10-30 北大方正集团有限公司 Method and device for identifying forms in digital format files
CN102722475A (en) * 2012-05-09 2012-10-10 深圳市万兴软件有限公司 Method for converting form in portable document format (PDF) document into Excel form
CN104063364A (en) * 2013-03-19 2014-09-24 福建福昕软件开发股份有限公司北京分公司 PDF document recognition method
CN104516867A (en) * 2013-09-30 2015-04-15 北大方正集团有限公司 Table reordering method and table reordering system

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763382A (en) * 2018-05-18 2018-11-06 中铁山桥集团有限公司 A method of the chart content in CAD program is imported into Excel programs
CN109062921A (en) * 2018-05-31 2018-12-21 武昌船舶重工集团有限公司 A kind of method and system for extracting ship pallet control information
CN109062921B (en) * 2018-05-31 2021-06-29 武昌船舶重工集团有限公司 Method and system for extracting ship tray management information
CN109933765A (en) * 2019-03-12 2019-06-25 中冶焦耐(大连)工程技术有限公司 A method of Excel table content is extracted to CAD table
CN109933765B (en) * 2019-03-12 2023-05-23 中冶焦耐(大连)工程技术有限公司 Method for extracting Excel table content to CAD table
CN110096783A (en) * 2019-04-25 2019-08-06 西门子电站自动化有限公司 The method that slave connection figure based on AutoCAD extracts connection data
CN110096783B (en) * 2019-04-25 2022-09-27 西门子电站自动化有限公司 Method for extracting connection data from connection graph based on AutoCAD
CN111985195A (en) * 2020-08-18 2020-11-24 上海外高桥造船有限公司 Text-based AUTOCAD table data reading method
CN112307725A (en) * 2020-10-30 2021-02-02 天津光电通信技术有限公司 Method for adding table information on two-dimensional drawing interface
CN112380826A (en) * 2020-11-12 2021-02-19 中国农业银行股份有限公司佛山分行 Formatted electronic form generation method based on text file
CN112380826B (en) * 2020-11-12 2024-03-22 中国农业银行股份有限公司佛山分行 Formatting electronic form generating method based on text file

Also Published As

Publication number Publication date
CN105912516B (en) 2019-02-05

Similar Documents

Publication Publication Date Title
CN105912516A (en) Method for one-lick extraction of table data from AutoCAD file
CN101377787B (en) Image searching device, image searching method
CN106484266A (en) A kind of text handling method and device
CN106325688A (en) Text processing method and device
JP2010140116A (en) File management apparatus, file management method, and file management program
CN104200240A (en) Sketch retrieval method based on content adaptive Hash encoding
CN105183338A (en) Object processing method
CN106502701A (en) The method and device of component alignment during a kind of establishment webpage
CN109613979B (en) Character input method and device, AR equipment and computer storage medium
CN103186241B (en) A kind of interactive desktop contact right-hand man's recognition methods
CN104992176B (en) A kind of Chinese character extracting method towards an inscription on a tablet
Li et al. Extended KLM for mobile phone interaction: a user study result
CN107463696A (en) A kind of method of Webpage largest block extraction
CN101894267B (en) Three-dimensional object characteristic view selection method
CN106951166A (en) Person's handwriting method for drafting and device
CN112241411B (en) Spreadsheet structured identification and extraction method based on CAD basic elements
CN105630380A (en) Element combining and splitting method and system
Li et al. A human-computer interactive dynamic description method for Jiaguwen Characters
CN112307725B (en) Method for adding table information on two-dimensional drawing interface
CN105653549A (en) Method and device for extracting document information
CN105975696B (en) Rule-based three-dimensional process dimension layout method
Cheng et al. Research on recognition method of interface elements based on machine learning
CN104778296B (en) Mathematical planning method for lithological description layout of drilling histogram
CN105096378B (en) A kind of method and computer aided design system for building three-dimensional body
CN102591845A (en) Method and device for processing overlapping text

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 210009 room A808, World Trade Center, No. 67 Shanxi Road, Gulou District, Jiangsu, China

Applicant after: Longkon wisdom Polytron Technologies Inc

Address before: Dongji Avenue Jiangning Development Zone in Nanjing City, Jiangsu province 211100 No. 1 Jiangsu Software Park Building No. 12 building langkun

Applicant before: Nanjing Luculent Software Co., Ltd.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: Floor 31, Asia Pacific business building, No. 2 Hanzhong Road, Gulou District, Nanjing, Jiangsu 210005

Patentee after: LUCULENT SMART TECHNOLOGIES CO.,LTD.

Address before: Room A808, World Trade Center Building, 67 Shanxi Road, Gulou District, Nanjing City, Jiangsu Province

Patentee before: LUCULENT SMART TECHNOLOGIES CO.,LTD.

CP02 Change in the address of a patent holder