CN112307725B - Method for adding table information on two-dimensional drawing interface - Google Patents

Method for adding table information on two-dimensional drawing interface Download PDF

Info

Publication number
CN112307725B
CN112307725B CN202011188133.8A CN202011188133A CN112307725B CN 112307725 B CN112307725 B CN 112307725B CN 202011188133 A CN202011188133 A CN 202011188133A CN 112307725 B CN112307725 B CN 112307725B
Authority
CN
China
Prior art keywords
electronic form
character
information
written
coordinates
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
CN202011188133.8A
Other languages
Chinese (zh)
Other versions
CN112307725A (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.)
Tianjin Optical Electrical Communication Technology Co Ltd
Original Assignee
Tianjin Optical Electrical Communication 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 Tianjin Optical Electrical Communication Technology Co Ltd filed Critical Tianjin Optical Electrical Communication Technology Co Ltd
Priority to CN202011188133.8A priority Critical patent/CN112307725B/en
Publication of CN112307725A publication Critical patent/CN112307725A/en
Application granted granted Critical
Publication of CN112307725B publication Critical patent/CN112307725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Abstract

The embodiment of the invention discloses a method for adding table information on a two-dimensional drawing interface, wherein the method comprises the following steps: acquiring an area range to be written into the electronic form; acquiring coordinates to be written into the electronic form; drawing a separation line according to the area range and the coordinates, wherein the separation line comprises: horizontal and vertical lines; caching the text information in the electronic form in a memory, wherein the text information comprises: character encoding, character font and character size; and reading the character information cached in the memory, and generating the electronic form on the two-dimensional drawing interface according to the character information and the dividing line. The technical problem that a large memory is occupied in the drawing process and after the drawing is shown can be effectively solved.

Description

Method for adding table information on two-dimensional drawing interface
Technical Field
The invention relates to the technical field of computer aided design, in particular to a method for adding form information to a two-dimensional drawing interface.
Background
Computer Aided Design (CAD) technology has been widely used in various fields of engineering as an outstanding engineering achievement. The development and application of the CAD system enable the traditional product design method and production mode to be deeply changed, and great social and economic benefits are generated.
AutoCAD (AutoCAD Computer Aided Design) is automatic Computer Aided Design software developed by Autodesk company in 1982 for the first time, and is used for two-dimensional drawing, detailed drawing, document Design and basic three-dimensional Design, and the heavy work of changing sketches into working drawings can be finished by computers; the design result automatically generated by the computer can quickly make a figure, so that designers can judge and modify the design in time, and the drawing tool becomes a widely international drawing tool.
In the process of implementing the invention, the inventor finds the following technical problems: the information in the excel form cannot be directly copied to the dwg drawing in the current AutoCAD software. Tables presented in the drawings are all drawn by manual operation to form horizontal line segments and vertical line segments, and corresponding characters are added manually at corresponding positions. The AutoCAD software cannot realize cell operation in excel such as batch copy of characters, digital calculation and the like. If the text information is forcibly copied, the text information is automatically converted into a picture type with a white background, and the text information is not easy to modify or extract information by a plotter after being added to a dwg drawing; the integral drawing is not beautiful; and simultaneously, the system occupies larger storage space and has higher memory consumption.
Disclosure of Invention
The embodiment of the invention provides a method for adding form information in a two-dimensional drawing interface, which aims to solve the technical problem that electronic form information is inconvenient to add in a CAD (computer-aided design) in the prior art.
Specifically, an embodiment of the present invention provides a method for adding table information in a two-dimensional drawing interface, including:
acquiring an area range to be written into the electronic form;
acquiring coordinates to be written into the electronic form;
drawing a separation line according to the area range and the coordinates, wherein the separation line comprises: horizontal and vertical lines;
caching the text information in the electronic form in a memory, wherein the text information comprises: character codes, character fonts and character sizes;
and reading the character information cached in the memory, and generating the electronic form on the two-dimensional drawing interface according to the character information and the dividing line.
Further, the drawing the separation line according to the area range and the coordinates includes:
and when the cells are detected to have the merged attribute in the detection range, deleting the line segments corresponding to the merged attribute after the separation line is drawn.
Further, the obtaining the area range to be written into the electronic form includes:
and reading the area range to be written into the electronic form by utilizing the file interface of the electronic form.
Further, the generating a spreadsheet on a two-dimensional drawing interface according to the text information and the dividing line includes:
adjusting the font size of the characters according to the coordinates, and determining a writing position according to the separation line;
and writing corresponding characters according to the writing position.
Further, the method further comprises:
acquiring the selection content of a two-dimensional drawing interface;
reading character information and position information corresponding to the character information from the selected content;
generating a character matrix according to the character information and the position information corresponding to the character information;
and generating a corresponding electronic table in an electronic table file according to the character matrix.
According to the method for adding the table information to the two-dimensional drawing interface, provided by the embodiment of the invention, the area range to be written in the electronic table is obtained; acquiring coordinates to be written into the electronic form; drawing a separation line according to the area range and the coordinates, wherein the separation line comprises: horizontal and vertical lines; caching the text information in the electronic form in a memory, wherein the text information comprises: character encoding, character font and character size; and reading the character information cached in the memory, and generating the electronic form on the two-dimensional drawing interface according to the character information and the dividing line. The elements in the electronic form can be split according to the character information and the form, the dividing lines of various forms are drawn by using the drawing function of cad, and the character information is converted into characters which can be realized by two-dimensional drawing software. The purpose of automatically drawing the table on a two-dimensional drawing software interface is achieved. And the technical problem that a large memory is occupied in the drawing process and after the drawing is shown can be effectively solved.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments thereof, made with reference to the following drawings:
fig. 1 is a schematic flowchart of a method for adding table information on a two-dimensional mapping interface according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for adding table information to a two-dimensional drawing interface according to an embodiment of the present invention, where the embodiment is applicable to a case where table information is added to a two-dimensional drawing interface, the method may be executed by a two-dimensional drawing interface table information adding apparatus, and may be integrated into a calculation for implementing two-dimensional drawing and spreadsheet generation operations, and specifically includes the following steps:
s110, acquiring the area range to be written into the electronic form.
In this embodiment, the spreadsheet to be written may be an excel or WPS spreadsheet file. The region range of the spreadsheet selected by the user can be obtained through the spreadsheet file, for example: from A1 to D6, rectangular areas are indicated where the extent of the area to be written to the spreadsheet lies between the extents of spreadsheets A1 to D6. Optionally, the obtaining the area range to be written into the electronic form may include: and reading the area range to be written into the electronic form by utilizing the file interface of the electronic form. The area range to be written into the electronic form can be automatically read through the interface.
And S120, acquiring the coordinates to be written into the electronic form.
In this embodiment, the two-dimensional drawing software includes computer aided drawing software such as AutoCad. After the area range to be written in the electronic form is obtained, the written coordinates need to be determined when the electronic form information is written in computer aided drawing software. In this embodiment, the coordinates to be written in the electronic form may be obtained in two ways, one is to read the coordinates of the two-dimensional drawing interface input by the user in a dialog box way. And the other method is that after the user selects the corresponding command for writing the electronic form, the position of the drawing symbol controlled by the mouse by the user on the current interface is read as the coordinate of the electronic form to be written.
S130, drawing a separation line according to the area range and the coordinates, wherein the separation line comprises: horizontal lines and vertical lines.
The obvious difference in spreadsheets is the dividing line. How to draw a proper dividing line in a two-dimensional drawing interface is a difficulty in the prior art. In this embodiment, a separation line is drawn according to the region range and the coordinates, the separation line including: horizontal and vertical lines. The electronic form includes: horizontal and vertical lines, and therefore, the horizontal and vertical lines need to be drawn.
The number of horizontal lines and vertical lines is determined by reading the area range of the electronic form in the present embodiment. And further determining a table interval in the electronic table, and determining corresponding horizontal lines and vertical lines through the table interval. Correspondingly, according to the coordinates to be written into the electronic form determined in the above steps. The coordinates of the spreadsheet to be written may be used as the starting point of the outer frame, and then all the horizontal lines and the vertical lines are drawn in sequence.
Optionally, in this embodiment, because a part of the tables has a merging condition, the electronic table drawn in the above manner may have a certain error. Therefore, in this embodiment, the drawing the separation line according to the region range and the coordinates may further include: and when the cell is detected to have the merged attribute in the detection range, deleting the line segment corresponding to the merged attribute after drawing the separating line.
Since there are often merge tables in the table, the split line in the merge table changes due to the merge. Therefore, the dividing line of the merged table needs to be drawn so that the table drawn in the two-dimensional charting interface coincides with the table information in the electronic table.
For example, the merge attribute in the table may be obtained through an interface of the electronic table, and a position corresponding to the merge table is determined according to the merge attribute. Correspondingly, after the drawing of the dividing line is finished, the line segment corresponding to the merging attribute is deleted according to the position.
S140, caching the text information in the electronic form in a memory, where the text information includes: text code, text font and text size.
For example, the text information in the spreadsheet may be cached and stored in memory. Optionally, a corresponding area may be set in the memory to cache the text information. Optionally, the text information may include: text code, text font and text size. The use of text encoding avoids the errors that occur when different types of fonts are converted between spreadsheets and two-dimensional charting. The text font may express a change in the text font, and the text size indicates a size of the text that matches the table. Optionally, a corresponding interface may also be set for the user to adjust the font and size of the text, so as to better meet the requirements of the customer.
And S150, reading the character information cached in the memory, and generating the electronic form on the two-dimensional drawing interface according to the character information and the dividing line.
And reading the character information from the cache, and writing the characters into a range in a dividing line in a two-dimensional drawing interface according to the dividing line.
For example, the generating a spreadsheet on a two-dimensional drawing interface according to the text information and the dividing line may include: adjusting the font size of the characters according to the coordinates, and determining a writing position according to the separation line; and writing corresponding characters according to the writing position.
In some cases, the user defines the table size in the two-dimensional mapping interface, which is defined by two coordinates of a diagonal. Therefore, in this embodiment, the font size needs to be adjusted according to the coordinates so that the written characters meet the size requirements of the table.
And determining a corresponding character writing position according to the dividing line, and writing the characters into the corresponding writing position.
The embodiment obtains the area range to be written into the electronic form; obtaining coordinates to be written into the spreadsheet; drawing a separation line according to the area range and the coordinates, wherein the separation line comprises: horizontal and vertical lines; caching the text information in the electronic form in a memory, wherein the text information comprises: character encoding, character font and character size; and reading the character information cached in the memory, and generating an electronic table on a two-dimensional drawing interface according to the character information and the dividing line. The elements in the electronic form can be split according to the character information and the form, the dividing lines of various forms are drawn by using the drawing function of cad, and the character information is converted into characters which can be realized by two-dimensional drawing software. The purpose of automatically drawing the table on a two-dimensional drawing software interface is achieved. And the technical problem that a large memory is occupied in the drawing process and after the drawing is shown can be effectively solved.
In a preferred implementation of this embodiment, the method may further include the steps of: acquiring the selection content of a two-dimensional drawing interface; reading character information and position information corresponding to the character information from the selected content; generating a character matrix according to the character information and the position information corresponding to the character information; and generating a corresponding electronic form in an electronic form file according to the character matrix. By the method, the form information in the two-dimensional drawing interface can be converted into the electronic form file without loss, the workload of inputting electronic form data by a user is reduced, and the working efficiency is improved.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (4)

1. A method for adding table information in a two-dimensional drawing interface is characterized by comprising the following steps:
acquiring an area range to be written into the electronic form;
obtaining coordinates to be written into the spreadsheet;
drawing a separation line according to the area range and the coordinates, wherein the separation line comprises: horizontal and vertical lines;
determining the number of horizontal lines and vertical lines by reading the region range of the electronic form;
determining a table interval in the electronic table, and determining corresponding horizontal lines and vertical lines through the table interval;
taking the coordinates of the spreadsheet to be written as the starting point of the outer frame, and further drawing all horizontal lines and all vertical lines in sequence;
when the cells are detected to have the merged attribute in the detection range, deleting line segments corresponding to the merged attribute after drawing the separating lines;
caching the text information in the electronic form in a memory, wherein the text information comprises: character encoding, character font and character size;
and reading the character information cached in the memory, and generating the electronic form on the two-dimensional drawing interface according to the character information and the separation line.
2. The method of claim 1, wherein obtaining the extent of the area to be written into the spreadsheet comprises:
and reading the area range to be written into the electronic form by utilizing the file interface of the electronic form.
3. The method of claim 1, wherein generating a spreadsheet on a two-dimensional charting interface from the textual information and the lines of separation comprises:
adjusting the font size of the characters according to the coordinates, and determining a writing position according to the separation line;
and writing corresponding characters according to the writing position.
4. The method of claim 1, further comprising:
acquiring the selection content of a two-dimensional drawing interface;
reading character information and position information corresponding to the character information from the selected content;
generating a character matrix according to the character information and the position information corresponding to the character information;
and generating a corresponding electronic form in an electronic form file according to the character matrix.
CN202011188133.8A 2020-10-30 2020-10-30 Method for adding table information on two-dimensional drawing interface Active CN112307725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011188133.8A CN112307725B (en) 2020-10-30 2020-10-30 Method for adding table information on two-dimensional drawing interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011188133.8A CN112307725B (en) 2020-10-30 2020-10-30 Method for adding table information on two-dimensional drawing interface

Publications (2)

Publication Number Publication Date
CN112307725A CN112307725A (en) 2021-02-02
CN112307725B true CN112307725B (en) 2022-11-25

Family

ID=74332428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011188133.8A Active CN112307725B (en) 2020-10-30 2020-10-30 Method for adding table information on two-dimensional drawing interface

Country Status (1)

Country Link
CN (1) CN112307725B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115329730A (en) * 2022-07-11 2022-11-11 中国建筑西南设计研究院有限公司 Spreadsheet operation management method suitable for graphic platform

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045948A (en) * 2015-05-25 2015-11-11 中国华电工程(集团)有限公司 Method for automatically batch generating configuration diagrams of transmitter protection box

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101882225B (en) * 2009-12-29 2013-09-18 北京中科辅龙计算机技术股份有限公司 Engineering drawing material information extraction method and system based on template
CN105912516B (en) * 2016-04-01 2019-02-05 朗坤智慧科技股份有限公司 A method of the one-touch extraction list data from autocad file
CN108763382A (en) * 2018-05-18 2018-11-06 中铁山桥集团有限公司 A method of the chart content in CAD program is imported into Excel programs
CN109933765B (en) * 2019-03-12 2023-05-23 中冶焦耐(大连)工程技术有限公司 Method for extracting Excel table content to CAD table

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045948A (en) * 2015-05-25 2015-11-11 中国华电工程(集团)有限公司 Method for automatically batch generating configuration diagrams of transmitter protection box

Also Published As

Publication number Publication date
CN112307725A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US7982737B2 (en) System and method for independent font substitution of string characters
US10127221B2 (en) Detection and reconstruction of East Asian layout features in a fixed format document
US7853869B2 (en) Creation of semantic objects for providing logical structure to markup language representations of documents
US7750924B2 (en) Method and computer-readable medium for generating graphics having a finite number of dynamically sized and positioned shapes
CN103500296A (en) Inlaying method and device of digital watermarks in text documents
JP6430197B2 (en) Electronic apparatus and method
CN105511792A (en) In-position hand input method and system for form
CN101630335A (en) Method for comparing similarity and difference between drawings
US6232985B1 (en) Interactive, dynamic, automatic dimension arrangement generator for computer-aided drafting programs
EP2807603A1 (en) Formula detection engine
WO2012037721A1 (en) Handwritten character font library
CN110096275B (en) Page processing method and device
CN111258575B (en) Page layout processing method and device
CN105654022A (en) Method and device for extracting structured document information
CN105404683A (en) Format file processing method and apparatus
CN112307725B (en) Method for adding table information on two-dimensional drawing interface
CN102024077B (en) Engineering drawing processing method
JP2020140450A (en) Structured data generation method and structured data generation device
CN104408267A (en) Finite element modeling method for special-shaped spatial structure
US11030388B2 (en) Live text glyph modifications
CN112241411B (en) Spreadsheet structured identification and extraction method based on CAD basic elements
CN114637732A (en) DWG drawing data conversion method and system
CN110032718B (en) Table conversion method, system and storage medium
KR101758098B1 (en) Electronic terminal apparatus for copying to keep the shape of the character in the pdf document and method for copying to keep the shape of the character in the pdf document of the electronic terminal apparatus
JP2012128609A (en) Drawing creation support method and apparatus

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