CN112149204B - Method for automatically searching position pointed by annotation instruction in CAD file - Google Patents

Method for automatically searching position pointed by annotation instruction in CAD file Download PDF

Info

Publication number
CN112149204B
CN112149204B CN202010999791.9A CN202010999791A CN112149204B CN 112149204 B CN112149204 B CN 112149204B CN 202010999791 A CN202010999791 A CN 202010999791A CN 112149204 B CN112149204 B CN 112149204B
Authority
CN
China
Prior art keywords
line
marking line
marking
horizontal
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.)
Active
Application number
CN202010999791.9A
Other languages
Chinese (zh)
Other versions
CN112149204A (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.)
Anhui Hongshen Technology Co ltd
Original Assignee
Anhui Hongshen 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 Anhui Hongshen Technology Co ltd filed Critical Anhui Hongshen Technology Co ltd
Priority to CN202010999791.9A priority Critical patent/CN112149204B/en
Publication of CN112149204A publication Critical patent/CN112149204A/en
Application granted granted Critical
Publication of CN112149204B publication Critical patent/CN112149204B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • G06F30/12Geometric CAD characterised by design entry means specially adapted for CAD, e.g. graphical user interfaces [GUI] specially adapted for CAD
    • 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/13File access structures, e.g. distributed indices
    • 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/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • G06F16/1794Details of file format conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computational Mathematics (AREA)
  • Architecture (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for automatically searching the position pointed by a mark instruction in a CAD file, which comprises the steps of converting the CAD file into an SHP file; dividing the graph data of the SHP file into a pipeline table, a marked line table and a marked point table by using desktop GIS software and storing the pipeline table, the marked line table and the marked point table in a spatial database; in the storage process of PostgreSQL, some marking points needing matching are screened through like according to description fields in a marking point table, and then a horizontal line closest to the marking points is searched through calculation according to geometry information of the marking points; finding the nearest line through a spatial database st _ discrete function, and judging whether the line is a horizontal marking line or not through the difference value of the dimensionality of the starting point and the dimensionality of the ending point of the marking line; if the difference value of the dimensionality of the starting point and the dimensionality of the end point of the marking line are within the specified range, the marking line is determined to be a horizontal marking line, otherwise, the marking line is not the horizontal marking line; setting the length of the horizontal marking line, and if the length is within a specified range, determining the horizontal marking line as the horizontal marking line, otherwise, determining the horizontal marking line as the non-horizontal marking line; the diagonal line connecting with the horizontal marking line is searched through the ST _ Touches function of the spatial database.

Description

Method for automatically searching position pointed by annotation instruction in CAD file
Technical Field
The invention relates to the technical field of searching CAD files, in particular to a method for automatically searching positions pointed by a caption in a CAD file.
Background
In the work of converting the CAD file into GIS map information, the CAD file can be converted into SHP usually, and then the SHP is further recorded into a postgis database. Therefore, data can be further accurately processed or specific application functions can be realized, but a lot of marking information (see fig. 1) exists in a CAD file, points to a specific position in a CAD drawing, and a specific description is made on the position, but the position of the marking information and the actual position information of a described accessory are not the same, and the actual position of a certain accessory needs to be known in some algorithms.
Disclosure of Invention
The present invention is directed to a method for automatically searching the position pointed by the caption in the CAD file, so as to solve the problems mentioned in the background art.
In order to achieve the purpose, the invention provides the following technical scheme: a method of automatically locating a location in a CAD file pointed to by a caption, the method comprising:
s1: after receiving a CAD file, correcting lines in the CAD file according to the average word height of a page in the CAD file and a preset line direction;
s2: converting the corrected CAD file into an SHP file;
s3: dividing the graph data of the SHP file into a pipeline table, a marked line table and a marked point table by using desktop GIS software and storing the pipeline table, the marked line table and the marked point table in a spatial database;
s4: in the storage process of the spatial database, some marking points needing to be matched are screened through like according to the description fields in the marking point table, and then a nearest horizontal line is searched through calculation according to the geometric information of the marking points;
s5: finding the closest line through a spatial database st _ discrete function, and judging whether the closest line is a horizontal marking line or not through the difference value of the dimensionality of the starting point and the end point of the marking line;
s6: if the difference value of the dimensionality of the starting point and the dimensionality of the end point of the marking line are within a specified range, the marking line is determined to be a horizontal marking line, and if not, the marking line is not a horizontal marking line;
s7: setting the length of a horizontal marking line, wherein if the length is within a specified range, the horizontal marking line is determined, otherwise, the horizontal marking line is not determined;
s8: searching a diagonal line connected with the horizontal marking line through an ST _ Touches function of a spatial database;
s9: finding another end point on the oblique line which is not in contact with the horizontal marking line through an FOR loop, wherein the end point is the position of the point which is actually pointed;
s10: storing the position of the endpoint in a data table;
s11: and the batch processing module receives the data table parameters, converts the SHP file into an SQL file through a batch processing file, and inserts the SQL file into a spatial database to finish data arrangement.
Preferably, the SHP file is a spatial data open format file.
Preferably, the desktop GIS software is a QGIS software of an open source geographic information system.
Preferably, the number of the oblique lines is at least one, and the number of the end points is at least one.
Compared with the prior art, the invention has the beneficial effects that: the invention provides a method for searching for the marking positions in a CAD file, which is realized by combining java codes, can accurately match and correspond the actual marking positions with the marking information in batches, and is efficient, accurate, time-saving and labor-saving.
Drawings
FIG. 1 is a flow chart of a search method of the present invention;
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention provides a technical solution: a method for automatically searching the pointed position of the annotation in CAD file features that the marked lines in CAD drawing are regular and have a horizontal line with marked words and an inclined pointed line for pointing to specific position. In addition, the marking lines, the marking points and the pipelines are not in one layer, so that the pipelines, the marking points and the marking lines can be completely distinguished.
The method comprises the following steps:
s1: after receiving a CAD file, correcting lines in the CAD file according to the average word height of a page in the CAD file and a preset line direction;
s2: converting the corrected CAD file into an SHP file;
s3: dividing the graph data of the SHP file into a pipeline table, a marked line table and a marked point table by using desktop GIS software and storing the pipeline table, the marked line table and the marked point table in a spatial database;
s4: in the storage process of the spatial database, some marking points needing to be matched are screened through like according to the description fields in the marking point table, and then a nearest horizontal line is searched through calculation according to the geometric information of the marking points;
s5: finding the nearest line through a spatial database st _ discrete function, and judging whether the line is a horizontal marking line or not through the difference value of the dimensionality of the starting point and the dimensionality of the ending point of the marking line;
s6: if the difference value of the dimensionality of the starting point and the dimensionality of the ending point of the marking line are within a specified range, the marking line is determined to be a horizontal marking line, otherwise, the marking line is not the horizontal marking line;
s7: setting the length of a horizontal marking line, wherein if the length is within a specified range, the horizontal marking line is determined, otherwise, the horizontal marking line is not determined;
s8: searching a diagonal line connected with the horizontal marking line through an ST _ Touches function of a spatial database;
s9: finding another end point on the oblique line which is not in contact with the horizontal marking line through an FOR loop, wherein the end point is the position of the point which is actually pointed;
s10: storing the position of the endpoint in a data table;
s11: and the batch processing module receives the data table parameters, converts the SHP file into an SQL file through a batch processing file, and inserts the SQL file into a spatial database to finish data sorting.
Preferably, the SHP file is a spatial data open format file.
Preferably, the desktop GIS software is a QGIS software of an open source geographic information system.
Preferably, the number of the oblique lines is at least one, the number of the end points is at least one, and there may be a plurality of oblique lines, then the other end point which is intersected with the pointing direction and contacted with the horizontal line marking line is the actual position of the pointing direction.
The invention provides a method for searching for the marked positions in a CAD file, which is realized by combining java codes, can accurately match and correspond the marked actual positions with the marked information in batches, and is efficient, accurate, time-saving and labor-saving.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (4)

1. A method for automatically locating a location in a CAD file pointed to by a caption, the method comprising:
s1: after receiving a CAD file, correcting lines in the CAD file according to the average word height of a page in the CAD file and a preset line direction;
s2: converting the corrected CAD file into an SHP file;
s3: dividing the graph data of the SHP file into a pipeline table, a marked line table and a marked point table by using desktop GIS software and storing the pipeline table, the marked line table and the marked point table in a spatial database;
s4: in the storage process of the spatial database, some marking points needing to be matched are screened through like according to the description fields in the marking point table, and then a nearest horizontal line is searched through calculation according to the geometric information of the marking points;
s5: finding the nearest line through a spatial database st _ discrete function, and judging whether the line is a horizontal marking line or not through the difference value of the dimensionality of the starting point and the dimensionality of the ending point of the marking line;
s6: if the difference value of the dimensionality of the starting point and the dimensionality of the end point of the marking line are within a specified range, the marking line is determined to be a horizontal marking line, and if not, the marking line is not a horizontal marking line;
s7: setting the length of a horizontal marking line, wherein if the length is within a specified range, the horizontal marking line is determined, otherwise, the horizontal marking line is not determined;
s8: searching a diagonal line connected with the horizontal marking line through an ST _ Touches function of a spatial database;
s9: finding another end point on the oblique line which is not in contact with the horizontal marking line through an FOR loop, wherein the end point is the position of the point which is actually pointed;
s10: storing the position of the end point into a data table;
s11: and the batch processing module receives the data table parameters, converts the SHP file into an SQL file through a batch processing file, and inserts the SQL file into a spatial database to finish data arrangement.
2. The method of claim 1, wherein the method comprises the steps of: the SHP file is a spatial data open format file.
3. The method of claim 1, wherein the location pointed to by the caption in the CAD file is automatically located by: the desktop GIS software is QGIS software of an open source code GIS.
4. The method of claim 1, wherein the method comprises the steps of: the number of the oblique lines is at least one, and the number of the end points is at least one.
CN202010999791.9A 2020-09-22 2020-09-22 Method for automatically searching position pointed by annotation instruction in CAD file Active CN112149204B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010999791.9A CN112149204B (en) 2020-09-22 2020-09-22 Method for automatically searching position pointed by annotation instruction in CAD file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010999791.9A CN112149204B (en) 2020-09-22 2020-09-22 Method for automatically searching position pointed by annotation instruction in CAD file

Publications (2)

Publication Number Publication Date
CN112149204A CN112149204A (en) 2020-12-29
CN112149204B true CN112149204B (en) 2022-07-26

Family

ID=73892768

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010999791.9A Active CN112149204B (en) 2020-09-22 2020-09-22 Method for automatically searching position pointed by annotation instruction in CAD file

Country Status (1)

Country Link
CN (1) CN112149204B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114429639B (en) * 2022-01-27 2024-05-03 广联达科技股份有限公司 Pipeline annotation recognition method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008105611A1 (en) * 2007-02-28 2008-09-04 Korea Rail Network Authority Database auto-building method for link of search data in gis system using cad drawings
CN106202708A (en) * 2016-07-08 2016-12-07 增城市城乡规划测绘院 A kind of method that the CAD topography that prospecting mapping draws quickly is put in storage
CN106528943A (en) * 2016-10-14 2017-03-22 厦门什嘉信息科技有限公司 Cable well data imaging method
CN106777811A (en) * 2017-01-16 2017-05-31 昆明理工大学 A kind of traffic channelling Map Design development approach

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004086753A (en) * 2002-08-28 2004-03-18 Merchandising On:Kk Data processing apparatus, data processing method, and program therefor
US7284192B2 (en) * 2004-06-24 2007-10-16 Avaya Technology Corp. Architecture for ink annotations on web documents
JP2008033875A (en) * 2006-07-03 2008-02-14 Bigvan Inc Layering program of cad drawing data, recording medium and device therefor, and layering system therefor, and cad drawing reference data checking device
CN101650754A (en) * 2008-08-11 2010-02-17 鸿富锦精密工业(深圳)有限公司 System and method for marking dimension of dynamically previewable graphics
EP3627360A1 (en) * 2018-09-21 2020-03-25 Bricsys NV Improved annotation positioning in a cad drawing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008105611A1 (en) * 2007-02-28 2008-09-04 Korea Rail Network Authority Database auto-building method for link of search data in gis system using cad drawings
CN106202708A (en) * 2016-07-08 2016-12-07 增城市城乡规划测绘院 A kind of method that the CAD topography that prospecting mapping draws quickly is put in storage
CN106528943A (en) * 2016-10-14 2017-03-22 厦门什嘉信息科技有限公司 Cable well data imaging method
CN106777811A (en) * 2017-01-16 2017-05-31 昆明理工大学 A kind of traffic channelling Map Design development approach

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CAD矢量数据向ArcGIS转换的方法;谢江平等;《地理空间信息》;20100828(第04期);140-142 *
基于ArcEngine组件技术的宗地图自动生成研究;杨大兵等;《勘察科学技术》;20100420(第02期);33-37 *
基于ArcGIS的依兰上游河段数字地形建模;王太伟等;《科技资讯》;20160803(第10期);15-18 *
基于SINOVATION系统的三维标注的实现与应用;荆海杰;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑(月刊)》;20160215(第02期);I138-1920 *

Also Published As

Publication number Publication date
CN112149204A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN110750840B (en) Method and device for automatically generating two-dimensional part view based on three-dimensional model
CN112149204B (en) Method for automatically searching position pointed by annotation instruction in CAD file
CN111159982B (en) Document editing method, device, electronic equipment and computer readable storage medium
CN104537098A (en) CAD blueprint search method based on GIS technology
CN113127125B (en) Page automatic adaptation method, device, equipment and storage medium
CN107315817B (en) Electronic drawing text matching method and device, storage medium and computer equipment
CN112698868B (en) Unified error code method applied to multiple systems and storage device
CN109299205B (en) Method and device for warehousing spatial data used by planning industry
CN110362596A (en) A kind of control method and device of text Extracting Information structural data processing
CN111143478A (en) Two-three-dimensional file association method based on lightweight model and engineering object bit number
WO2016034062A1 (en) Information lookup method and device
WO2020108345A1 (en) Database index and database query processing method, apparatus, and device
CN110888965A (en) Document data extraction method and device
CN112347131B (en) Urban rail project demand identification and coverage method and device
CN112597192A (en) Data query method, device, server and medium
CN110688439A (en) Method for automatically identifying and analyzing enterprise information based on regional geocoding
CN110717207A (en) Labeling method, system and storage medium for pipeline design
CN104268277A (en) Data reading method and device for database
CN108920749B (en) Pipeline two-dimensional and three-dimensional data updating method and device and computer readable storage medium
CN112836472A (en) Address annotation method, device, equipment and storage medium
CN112987653B (en) Method and device for converting Chinese program into G code
CN114691610A (en) Directory processing method and device, storage medium and processor
CN110321846B (en) 3D (three-dimensional) graphic processing method and device, processing method and electronic terminal
CN101937477A (en) Data processing equipment, system and method for realizing figure file fitting
CN111160018A (en) Method and system for recognizing non-component text of electrical drawing 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 501, block B, Chaoyuan Science Park, 919 Wenqu Road, high tech Zone, Hefei City, Anhui Province 230000

Applicant after: Anhui Hongshen Technology Co.,Ltd.

Address before: Room 501, block B, Chaoyuan Science Park, 919 Wenqu Road, high tech Zone, Hefei City, Anhui Province 230000

Applicant before: HEFEI XIAOGUI KUAIPAO INFORMATION TECHNOLOGY CO.,LTD.

GR01 Patent grant
GR01 Patent grant