CN116205206A - Method for importing CAD (computer aided design) form data into EXCEL form - Google Patents

Method for importing CAD (computer aided design) form data into EXCEL form Download PDF

Info

Publication number
CN116205206A
CN116205206A CN202211617782.4A CN202211617782A CN116205206A CN 116205206 A CN116205206 A CN 116205206A CN 202211617782 A CN202211617782 A CN 202211617782A CN 116205206 A CN116205206 A CN 116205206A
Authority
CN
China
Prior art keywords
cad
text
data
excel
importing
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.)
Pending
Application number
CN202211617782.4A
Other languages
Chinese (zh)
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.)
Xian Aeronautics Computing Technique Research Institute of AVIC
Original Assignee
Xian Aeronautics Computing Technique Research Institute of AVIC
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 Xian Aeronautics Computing Technique Research Institute of AVIC filed Critical Xian Aeronautics Computing Technique Research Institute of AVIC
Priority to CN202211617782.4A priority Critical patent/CN116205206A/en
Publication of CN116205206A publication Critical patent/CN116205206A/en
Pending legal-status Critical Current

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention provides a method for importing CAD table data into an EXCEL table, which comprises the following steps: extracting the position coordinates of the lines according to the endpoints of the lines in the CAD table data, and forming a position space coordinate grid in a tool database of the CAD; extracting text characteristics according to text insertion point coordinates in CAD table data, judging the relative position of each text, and attaching relative position coordinate codes to each text in a space coordinate network to form a character string matrix; in a CAD environment, calling EXCEL through Visual LISP and Active X interface, creating a blank electronic table, and writing the ordered data in the character string matrix into the corresponding position of the blank electronic table according to position coordinate code, thus completing the importing of CAD table data into the EXCEL table. The method can rapidly and accurately import CAD table data into the EXCEL table.

Description

Method for importing CAD (computer aided design) form data into EXCEL form
Technical Field
The invention relates to the field of Auto CAD secondary development, in particular to a method for importing CAD table data into an EXCEL table.
Background
Auto CAD is widely used in various fields as a general-purpose drawing software. Along with the continuous improvement of various statistical demands, more and more materials, standard components, product matching detailed tables and the like in CAD design drawings are extracted, a large amount of data is required to be converted into EXCEL for reporting, and no effective method for directly extracting and importing table data in CAD files into the EXCEL tables exists at present.
The conventional method still needs to spend a large amount of time, the basic operation of the computer is "copy, paste" to manually input data, realize the extraction of the data in the detail table, but the manual input data is not only complicated in operation, the efficiency is extremely low, and is very easy to make mistakes.
Disclosure of Invention
In view of this, the embodiment of the application provides a method for importing CAD form data into an EXCEL form, so as to achieve the purpose of fast and accurately importing CAD form data into an EXCEL form.
The embodiment of the application provides the following technical scheme: a method of importing CAD form data into an EXCEL form, comprising:
extracting the position coordinates of the lines according to the endpoints of the lines in the CAD table data, and forming a position space coordinate grid in a tool database of the CAD;
extracting text characteristics according to text insertion point coordinates in CAD table data, judging the relative position of each text, and attaching relative position coordinate codes to each text in a space coordinate network to form a character string matrix;
in a CAD environment, calling EXCEL through Visual LISP and Active X interface, creating a blank electronic table, and writing the ordered data in the character string matrix into the corresponding position of the blank electronic table according to position coordinate code, thus completing the importing of CAD table data into the EXCEL table.
According to one embodiment of the application, the method further comprises the step of writing a query subprogram, wherein the query subprogram is used for extracting the line and text data in all tables through a recursion algorithm for the line and text in the multi-layer nested block so as to realize data conversion in the multi-layer nested block.
According to one embodiment of the application, when a plurality of character strings exist in a single cell in the CAD table, performing cell multi-text merging processing;
and the single-lattice multi-text merging processing is to judge the sequence according to the X coordinate size of each text insertion point and merge the text of the character string.
According to one embodiment of the application, the specific steps of the single-lattice multi-text merging process include:
firstly, determining the coordinates of the insertion points of each character string, determining the cell positions of the character strings according to the coordinate positions of the insertion points, sequencing according to the size and the position of the X coordinate points of the insertion points of the character strings, connecting the character strings together, putting the character strings into corresponding character string matrixes, and writing the character strings into an EXCEL table as one character string.
According to an embodiment of the application, an error control method is further adopted to eliminate errors of position coordinate values of two endpoints of the line, so that redundant coordinate points generated by conversion errors are removed.
According to one embodiment of the application, when a space appears in the CAD table, the correct conversion of the text is realized by a space filling text method.
According to one embodiment of the application, the method further comprises the step of controlling the attribute of the EXCEL form, adjusting the width of the form according to the quantity of data in each column of the electronic form, and setting the effective data area to include the appointed border linearity, the ground color number, the text font and the alignment mode.
According to the method for importing CAD table data into the EXCEL table, based on the Auto LISP language, the method for importing the CAD table data into the EXCEL table is developed, the method can be operated on Auto CAD platforms of all versions, the content of the CAD table data (comprising multiple layers of nested data tables) in an electronic version two-dimensional drawing can be rapidly extracted, and finally the table data are placed in the EXCEL table according to the sequence in the original CAD drawing for a user to use through text characteristic extraction, line position coordinate extraction, position error elimination processing module, text splicing and sorting module and the like. The method can be widely used for extracting data of CAD product catalogues and detail tables, rapidly generating the product matching tables, the BOM tables, the standard components, the material statistics tables and the like, is simple to operate, effectively improves the working efficiency, and has wide application prospect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a method of an embodiment of the present invention;
fig. 2 is an exemplary diagram of CAD form data importation EXCEL forms of an embodiment of the present invention.
Detailed Description
Embodiments of the present application are described in detail below with reference to the accompanying drawings.
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The technical solution of the present invention will be clearly and completely described below in detail with reference to the accompanying drawings in combination with the embodiments, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, an embodiment of the present invention provides a method for importing CAD form data into an EXCEL form, including:
s1, extracting position coordinates of a line according to endpoints of the line in CAD table data, and forming a position space coordinate grid in a tool database of CAD;
s2, extracting text characteristics according to text insertion point coordinates in CAD table data, judging the relative position of each text, and attaching relative position coordinate codes to each text in a space coordinate network to form a character string matrix;
s3, calling EXCEL through Visual LISP and Active X interface in CAD environment, creating a blank electronic table, and writing the well-ordered data in the character string matrix into the corresponding position of the blank electronic table according to position coordinate codes, thus completing the importing of CAD table data into the EXCEL table.
The working principle and logic of this embodiment are described as follows:
a) Extracting the position coordinates of the lines according to the endpoints of the form lines, and forming a position space coordinate grid in a tool database of the CAD; for lines and texts in the multi-layer nested block, a query subroutine is specially written, and related data in all tables are extracted through a recursion algorithm so as to support data conversion in the multi-layer nested block.
b) And eliminating errors of position coordinate values of two endpoints of the line by adopting an error control method so as to eliminate redundant coordinate points generated by conversion errors.
An error control method is set for eliminating redundant coordinate points generated by conversion errors for each line known from CAD software, wherein the coordinate values of the two endpoints of each line have errors.
Specifically, the line end point coordinates have errors of more than E-10 bits in the tool data acquisition, and a certain error amount, for example, the error amount w=0.001, must be set to obtain the horizontal or vertical line, and the intersection point of each line can be obtained, so as to form a grid array for controlling the arrangement sequence of the subsequent character string matrix.
c) Judging the relative position of each text according to the text insertion point coordinates, and attaching a relative position coordinate code to each text in a space coordinate network; when a plurality of texts are in a form frame, carrying out single-lattice multi-text merging processing, judging the sequence according to the X coordinate size of an insertion point, and merging the text of the character string;
specifically, when a plurality of character strings exist in a single cell in the table, the specific steps of the cell multi-text merging process include:
firstly, determining the coordinates of the insertion points of each character string, determining the cell positions of the character strings according to the coordinate positions of the insertion points, sequencing according to the size and the position of the X coordinate points of the insertion points of the character strings, connecting the character strings together, putting the character strings into corresponding character string matrixes, and writing the character strings into an EXCEL table as one character string.
d) When a space appears in the CAD table, the correct conversion of the text is realized by a space text filling method;
specifically, when the lattices in the CAD form are empty, if the sequences are ordered according to the Y coordinates of the acquired characters, the character strings to be later are filled in the original empty character string matrix, and the writing is inconsistent with the original CAD form. For this purpose, it is necessary to process spaces in a matrix formed by the lines, write a specific character string in advance, write the matrix, search the character string, and replace it with NIL, so that after writing EXCEL, it can be kept consistent with the original CAD form.
e) In a CAD (such as AutoCAD 2019) environment, an EXCEL (such as EXCEL 2017) is called through Visual LISP and Active X interface, a blank electronic table is created, and the ordered data is written into the corresponding position in the electronic table according to position coordinate codes.
f) And controlling the attribute of the EXCEL table, adjusting the width of the table according to the amount of data in each column of the electronic table, setting the linearity of a designated frame, the color number of the ground color, setting the font of the text, the alignment mode and the like in an effective data area.
An example of the method of the present embodiment when specifically executed is as follows, as shown in fig. 2:
in the AUTOCAD2019 environment, input at the Command line: eee, carriage return;
selecting form data in the CAD file according to the tool prompt, and then returning;
the system will create a new EXCEL application and generate a data table in the sheet1 spreadsheet as shown on the right side of fig. 2.
The method provided by the embodiment of the invention is simple to operate, and can be used for rapidly and accurately importing CAD table data into the EXCEL table, so that the working efficiency is greatly improved.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions easily conceivable by those skilled in the art within the technical scope of the present application should be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (7)

1. A method of importing CAD form data into an EXCEL form, comprising:
extracting the position coordinates of the lines according to the endpoints of the lines in the CAD table data, and forming a position space coordinate grid in a tool database of the CAD;
extracting text characteristics according to text insertion point coordinates in CAD table data, judging the relative position of each text, and attaching relative position coordinate codes to each text in a space coordinate network to form a character string matrix;
in a CAD environment, calling EXCEL through Visual LISP and Active X interface, creating a blank electronic table, and writing the ordered data in the character string matrix into the corresponding position of the blank electronic table according to position coordinate code, thus completing the importing of CAD table data into the EXCEL table.
2. The method of importing CAD form data into an EXCEL form of claim 1, further comprising writing a query subroutine for extracting lines and text data in all forms by a recursive algorithm for lines and text in the multi-level nested block to effect data transformation in the multi-level nested block.
3. The method of importing CAD form data into an EXCEL form of claim 1, further comprising performing a single-lattice multiple text merging process when there are multiple strings within a single cell in the CAD form;
and the single-lattice multi-text merging processing is to judge the sequence according to the X coordinate size of each text insertion point and merge the text of the character string.
4. The method for importing CAD form data into an EXCEL form according to claim 3, wherein the specific steps of the single-lattice multi-text merging process include:
firstly, determining the coordinates of the insertion points of each character string, determining the cell positions of the character strings according to the coordinate positions of the insertion points, sequencing according to the size and the position of the X coordinate points of the insertion points of the character strings, connecting the character strings together, putting the character strings into corresponding character string matrixes, and writing the character strings into an EXCEL table as one character string.
5. The method for importing CAD form data into EXCEL form according to claim 1, further comprising eliminating errors of position coordinate values of two endpoints of the line by an error control method to eliminate redundant coordinate points generated by conversion errors.
6. The method of importing CAD form data into an EXCEL form according to claim 1, wherein when a space appears in the CAD form, the correct conversion of the text is achieved by a space-filling text method.
7. The method of importing CAD form data into an EXCEL form according to claim 1, further comprising controlling EXCEL form attributes, adjusting form width according to the amount of each column of data in the electronic form, and setting a valid data area including a specified border linearity, ground color number, text font, and alignment.
CN202211617782.4A 2022-12-15 2022-12-15 Method for importing CAD (computer aided design) form data into EXCEL form Pending CN116205206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211617782.4A CN116205206A (en) 2022-12-15 2022-12-15 Method for importing CAD (computer aided design) form data into EXCEL form

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211617782.4A CN116205206A (en) 2022-12-15 2022-12-15 Method for importing CAD (computer aided design) form data into EXCEL form

Publications (1)

Publication Number Publication Date
CN116205206A true CN116205206A (en) 2023-06-02

Family

ID=86518124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211617782.4A Pending CN116205206A (en) 2022-12-15 2022-12-15 Method for importing CAD (computer aided design) form data into EXCEL form

Country Status (1)

Country Link
CN (1) CN116205206A (en)

Similar Documents

Publication Publication Date Title
US7853869B2 (en) Creation of semantic objects for providing logical structure to markup language representations of documents
CN111414165B (en) Interface code generation method and equipment
CN107544806A (en) Visualize list method for drafting
CN111428457B (en) Automatic formatting of data tables
CN105183489A (en) Extjs frame based intelligent data analysis system and method
CN106055717B (en) Method for integrally managing geographic information and map making data
CN105447200A (en) Data processing method and data processing apparatus
CN105069116A (en) Method and system for converting json string into array
CN114090611A (en) Method and device for generating cable inventory by terminal wiring table and electronic equipment
CN116205206A (en) Method for importing CAD (computer aided design) form data into EXCEL form
US20060238539A1 (en) Method and apparatus for glyph hinting by analysis of similar elements
US7447704B2 (en) Pivot analysis with XML/XSL mechanism
CN104281575A (en) Webpage data obtaining method and template engine
CN116956837A (en) Project determining method and device for engineering quantity list
CN112100993B (en) Form construction method and device, storage medium and electronic equipment
CN112241411B (en) Spreadsheet structured identification and extraction method based on CAD basic elements
Hung et al. Boxing code for stroke-order free handprinted Chinese character recognition
CN105487684B (en) The output intent of Chinese-character phonetic letter character and the output device of Chinese-character phonetic letter character
CN113642054A (en) CAD drawing data processing method, device and storage medium
CN105718673A (en) Spacing adjustment method for words on straight line of CAD
CN105117733A (en) Method and device for determining clustering sample difference
CN116136839B (en) Method, system and related equipment for generating legal document face manuscript
KR102614742B1 (en) Method for computerized date processing of point detail and recommendation method for point detail modeling file
KR20240020705A (en) Method for extracting and computerizing longitudinal section datas
CN111027304B (en) Text block sorting method and device, storage medium and electronic equipment

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