CN106202239B - A kind of CAD data generation SHAPE data file method and system - Google Patents

A kind of CAD data generation SHAPE data file method and system Download PDF

Info

Publication number
CN106202239B
CN106202239B CN201610496317.8A CN201610496317A CN106202239B CN 106202239 B CN106202239 B CN 106202239B CN 201610496317 A CN201610496317 A CN 201610496317A CN 106202239 B CN106202239 B CN 106202239B
Authority
CN
China
Prior art keywords
data
cad
file
shape
layer
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
CN201610496317.8A
Other languages
Chinese (zh)
Other versions
CN106202239A (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.)
Taihua Wisdom Industry Group Co Ltd
Original Assignee
Taihua Wisdom Industry Group 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 Taihua Wisdom Industry Group Co Ltd filed Critical Taihua Wisdom Industry Group Co Ltd
Priority to CN201610496317.8A priority Critical patent/CN106202239B/en
Publication of CN106202239A publication Critical patent/CN106202239A/en
Application granted granted Critical
Publication of CN106202239B publication Critical patent/CN106202239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • 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)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of CAD datas to generate SHAPE data file method and system, self-defining data structure before reading and writing of files, for storing the CAD data read;Batch specifies cad file, loads CAD data file;It is specified to want derived CAD data figure layer, it specifies and data is imported into tables of data;The specified file path for generating shape;One piece of batch specified data is exported in a shape file.The present invention once can specify multiple figure layers of similar element, improve the treatment effeciency of data;The similar entity of different layers is exported to a shape file, data file can be managed well, and the similar entity of different layers is not had to specified database repeatedly when such as database table.

Description

A kind of CAD data generation SHAPE data file method and system
Technical field
The present invention relates to computer data processing technology fields, and in particular to a kind of CAD data generation SHAPE data file Method and system.
Background technique
With becoming increasingly popular for Network Information epoch, we are in the epoch of a big data explosive increase, greatly Data have been widely used various fields, and far-reaching influence is generated in terms of social economy, political culture, people.This is just It is required that we go how to excavate and preferably handle big data.
The tool of processing big data is more at present, but sometimes also has its completion in terms of data-handling efficiency and function Thing not.This application involves be the similar element of CAD (Dxf format) data (element here refer to point, line, surface swear Measure data, including two and three-dimensional data) how data to press the data file that specified figure layer exports a shape format.
When exporting SHAPE data format by CAD data (assuming that data are correct), more common software arcmap10.1 The file of CAD data export shape data format may be implemented.Arcmap10.1 exports shape file and is put in storage such as Fig. 1 institute Show, arcmap batch presses congener entity when loading CAD (figure layer of CAD data is possible, and there are many solid datas of class) Data (point, line, surface) are layered, when exporting shape data can only figure layer export a shape file, for place Big data is managed, shape file derived in this way can be very much, and data volume is big, and craft must be needed when being not easy to manage, and being put in storage Creation database figure layer one by one, then replicated, paste and be put in storage by figure layer, cause working efficiency too low, process is complicated.
Summary of the invention
To solve the shortcomings of the prior art, the invention discloses a kind of CAD datas to generate SHAPE data file method And system, the present invention are realized the storage of CAD data by self-defining data structure, specified figure layer data are exported to one In shape data file.The present invention can reach CAD data export shape file and warehouse-in efficiency height and be able to achieve preferably Management to shape file.
To achieve the above object, concrete scheme of the invention is as follows:
A kind of CAD data generation SHAPE data file method, comprising the following steps:
Self-defining data structure before reading and writing of files, for storing the CAD data read;
Batch specifies cad file, loads CAD data file;
Derived CAD data figure layer is wanted in selection, and is imported data in the tables of data of database;
Generate the file path of shape;
The specified figure layer data of batch are exported to together in a shape file, shape file export function is executed.
Further, the CAD data of self-defining data structure storage is the multiple figure layers for specifying similar entity.
Further, self-defining data structure include store CAD point data point data structure, be used to store it is single more The polyline data structure of adopted line number evidence is used to store the data structure of single text data and is used to store a face data Face data structure.
Further, it reads cad file and creates a window interfaces when writing shape file, be arranged on window interfaces The parameter of data conversion: being arranged first button on window interfaces, and specified cad file is loaded when button event is clicked in triggering The dialog box in path realizes load cad file;
The second button is arranged on window interfaces to be used to load the dialog box for calling export path, specifies export Shape file path exports to specified figure layer data in one shape data file;
Third button is set on forms, when trigger button event, execution shape data file export function.
Further, single choice file or multiselect file, select corresponding CAD data figure layer, database when loading cad file Table and lists of data types.
Further, CAD data figure layer needs derived CAD diagram layer for storing CAD data, selection;Select CAD diagram layer While need to specify the data type of the figure layer from lists of data types, label export and the type for being put in storage the CAD diagram layer Data, while by interface specified database table, it is used to store the data of specified CAD diagram layer.
A kind of system that CAD data generates SHAPE data file, comprising:
Self-defining data construction module, for the self-defining data structure before reading and writing of files, self-defining data structure is used In the CAD data that storage is read;
Cad file read module loads CAD data file for specifying cad file in batches;
Data selecting module wants derived CAD data figure layer for selecting, and imports data to the data of database Table;
Path-generating module, for generating the file path of shape;
Shape file generating module writes the specified homogeneous data of batch in one shape file together.
Further, in self-defining data construction module, the CAD data of self-defining data structure storage is to specify similar reality Multiple figure layers of body.
Further, self-defining data structure include store CAD point data point data structure, be used to store it is single more The polyline data structure of adopted line number evidence is used to store the text data structure of single text data and is used to store a face The face data structure of data.
Further, it reads cad file and needs to create a window interfaces when generating shape file, in window interfaces The parameter of upper setting data conversion: being arranged the first button on window interfaces, and specified CAD is loaded when button event is clicked in triggering The dialog box of file path realizes load cad file;
The second button is arranged on window interfaces to be used to load the dialog box for calling export path, specifies export Shape file path exports to specified figure layer data in one shape data file;
Third button is set on forms, when trigger button event, execution shape data file export function.
Further, single choice file or multiselect file, select corresponding CAD data figure layer, database when loading cad file Table and lists of data types, CAD diagram layer can be with multiselects.
Beneficial effects of the present invention:
This patent processing data can export to one one piece of data because can specify multiple figure layers of similar entity In shape file, realization process is exactly specified similar entity to be all stored in the data structure for starting definition, is then written to In one shape file, and do not have to the tables of data that one figure layer of processing specifies a secondary storage, handles the efficiency of data in this way It can greatly improve, and too many shape file will not be generated, save memory space, because each shape file has one A file header occupies certain memory space.Remove the problem of shape data file management complexity from, this is currently processed data The function that cannot be achieved of software.
The present invention once can specify multiple figure layers of similar element, improve the treatment effeciency of data;Different layers Similar entity exports to a shape file, can be managed well data file, and the similar entity of different layers is existed Specified database table repeatedly is not had to when such as database table.
Detailed description of the invention
Figure 1A rcmap reads the process flow diagram flow chart that CAD generates shape;
The reading CAD data file that Fig. 2 present invention realizes generates shape flow chart;
The function performance flow chart of Fig. 3 reading cad file;
Fig. 4 writes the function performance flow chart of shape file.
Specific embodiment:
The present invention is described in detail with reference to the accompanying drawing:
As shown in Figure 1, Arcmap reads the process flow that CAD generates shape:
Step 1: loading CAD data in batches in arcmap;
Step 2: Arcmap carries out AUTOMATIC ZONING to data according to entity class, text layers are treated as annotation layer, at Figure;
Step 3: the file path of specified CAD diagram layer export shape data format, generates shape file.
Step 4: opening the editting function in arcmap, the specified tables of data that enter database carries out data loading;
Step 5: saving the data of storage, stop the editting function in arcmap.
Step 6: generating the file of a shape format, a CAD diagram layer generates shape and is disposed.
Step 7: three, four, five, six steps are repeated, until All Layers have been handled.
The above method when exporting shape data can only figure layer export a shape file, for handling big number According to shape file derived in this way can be very much, and creation number by hand one by one must be needed when being not easy to manage, and being put in storage It according to library figure layer, then replicated, paste and be put in storage by figure layer, cause working efficiency too low, process is complicated.
As shown in Fig. 2, the reading CAD data file of the realization of the application generates shape process:
Program is executed, specifies corresponding parameter on CAD data production shape parameter interface.
Step 1: batch specifies cad file, CAD data file is loaded
Step 2: specified want derived CAD data figure layer (similar figure layer can once specify multiple figure layers), specifies and want Data are imported into tables of data.
Step 3: the specified file path for generating shape.
Shape file is generated step 4: determining, clicks confirming button, executes shape file generated function, this shape Systematic function finishes.
Step 5: as there are also figure layer export to repeat three, four steps.Until All Layers have been handled.
By comparing " Arcmap reads the process flow that CAD generates shape " and " CAD data file is read in realization of the invention Generate shape process ", it can be seen that program code realizes that reading the step of CAD data generates shape simply writes, high-efficient, therefore should Invention is desirable.
The present invention uses the data structure of oneself definition, and definition data structure is realized before reading and writing of files, to be used for Store the CAD data read;By writing the reading cad file of code realization this patent and writing shape data file function performance: reading It takes cad file and writes shape file and need to create a window interfaces (Winform forms) in program, on window interfaces The parameter of data conversion is set: adding first button on window interfaces, it is literary that specified CAD is loaded when button event is clicked in triggering The dialog box in part path realizes load cad file, can be with single choice file also with multiselect file;CAD data figure layer (is load CAD data figure layer) and database table (be in the database store data table) and lists of data types (indicate figure layer Data type, for example the layer data is that point data must be talked about, then data type is exactly point POINT;If it is line number evidence, then Data type is exactly line POLYLINE;If it is face data, then data type is exactly POLYGON), the relationship between this three Summarize are as follows: CAD data figure layer is the layer for storing CAD data, and user is specified to want derived CAD diagram layer, can be with multiselect;User is specified Need to specify the data type of the figure layer while CAD diagram layer from lists of data types, label exports and be put in storage the CAD diagram layer Categorical data, while user is used to store the data of specified CAD diagram layer by interface specified database table.In forms circle On face plus second button is used to load the dialog box for calling export SHAPE file path, specifies export shape file path, Specified figure layer data are exported in a shape data file, which is that the CAD data of specified figure layer is stored To in data structure, on window interfaces plus third export SHAPE data button " exports " button, responds export event When, export a shape file;The specified figure layer that CAD data is put in storage of user;Carry out CAD data export shape data simultaneously Data are entered the method to database.
The function performance of data structure and reading data above is described herein:
Data structure used in Dxf file is read, these data structures all define before reading and writing of files, why fixed Justice these
Data structure is to store factor data.
Self-defining data structure includes storing the point data structure of the point data of CAD, is used to store single polyline data Polyline data structure, be used to store the text data structure of single text data, be used to store the face number an of face data According to structure.
Following code is program of the point data structure in definition, remaining data structure is similar.
For storing the point data set of cad file
Cad file reads function and realizes that process realizes each function performance by writing code:
It reads cad file function performance and realizes that process flow chart is shown as shown in figure 3, for CAD data file, one Having in a kind of or multiclass entity, such as a figure layer in a figure layer has point, line, surface, text etc. multiclass entity, is reading According to the mark of entity each in data file, (mark of point a little, the wired mark of line, face has when CAD data file The mark in face, text have the mark of text), data are stored in the respective data structure defined with (point is stored to point data respectively In structure, line is stored in line data structure, and face is stored in face data structure, and text is stored in text data structure etc.);
It writes shape file function functional procedure flow chart to show as shown in figure 4, for SHAPE data file, one A shape file can only store same class solid data or be point entity data file or be line solid data file, It is face entity data file.Specified similar solid data exports in a shape data file, for example specifies multiple CAD point figure layer is all write in a shape file when exporting shape data, and line and face data export shape data file Similarly.
It further include a kind of corresponding CAD data generation SHAPE data file of the above method in embodiments herein System, comprising:
Self-defining data construction module, for the self-defining data structure before reading and writing of files, self-defining data structure is used In the CAD data that storage is read;
Cad file read module loads CAD data file for specifying cad file in batches;
Data selecting module wants derived CAD data figure layer for selecting, and imports data to the data of database Table;
Path-generating module, for generating the file path of shape;
Shape file generating module, one piece of homogeneous data that batch is specified are write in a shape file.
Above-mentioned, although the foregoing specific embodiments of the present invention is described with reference to the accompanying drawings, not protects model to the present invention The limitation enclosed, those skilled in the art should understand that, based on the technical solutions of the present invention, those skilled in the art are not Need to make the creative labor the various modifications or changes that can be made still within protection scope of the present invention.

Claims (4)

1. a kind of CAD data generates SHAPE data file method, characterized in that the following steps are included:
Self-defining data structure before reading and writing of files, for storing the CAD data read;The storage of self-defining data structure CAD data is the multiple figure layers for specifying similar entity;
Batch specifies cad file, loads CAD data file;
Derived CAD data figure layer is wanted in selection, and is imported data in the tables of data of database;
Generate the file path of shape;
The data that batch is read are exported to together in a shape file;
It reads cad file and needs to create a window interfaces when writing shape file, data conversion is set on window interfaces Parameter: being arranged the first button on window interfaces, and the dialogue in specified cad file path is loaded when button event is clicked in triggering Frame realizes load cad file;
The second button is arranged on window interfaces to be used to load the dialog box for calling export path, specifies export shape text Part path exports to specified figure layer data in one shape data file;
Third button is set on forms, when trigger button event, execution shape data file export function;
Single choice file or multiselect file, select corresponding CAD data figure layer, database table and data class when loading cad file Type list;
CAD data figure layer needs derived CAD diagram layer for storing CAD data, selection;Select CAD diagram layer while need from The data type of the figure layer, label export and the data type for being put in storage the CAD diagram layer are specified in lists of data types, are passed through simultaneously Interface specified database table is used to store the data of specified CAD diagram layer.
2. a kind of CAD data as described in claim 1 generates SHAPE data file method, characterized in that self-defining data knot Structure include store CAD point data point data structure, be used to store single polyline data polyline data structure, be used to It stores the text data structure of single text data and is used to store the face data structure an of face data.
3. the system that a kind of CAD data generates SHAPE data file, characterized in that include:
Self-defining data construction module, for the self-defining data structure before reading and writing of files, self-defining data structure is for depositing Put the CAD data of reading;In self-defining data construction module, the CAD data of self-defining data structure storage is to specify similar reality Multiple figure layers of body;
Cad file read module loads CAD data file for reading cad file in batches;
Data selecting module wants derived CAD data figure layer for selecting, specified that data are imported into tables of data;
Path-generating module, for the specified file path for generating shape;
Shape file generating module exports to the data that batch is read in one shape file together;
It reads cad file and needs to create a window interfaces when generating shape file, data conversion is set on window interfaces Parameter: the first button is set on window interfaces, the dialogue in specified cad file path is loaded when button event is clicked in triggering Frame realizes load cad file;
The second button is arranged on window interfaces to be used to load the dialog box for calling export path, specifies export shape text Part path exports to specified figure layer data in one shape data file;
Third button is set on forms, when trigger button event, execution shape data file export function;
Single choice file or multiselect file, select corresponding CAD data figure layer and database table and data class when loading cad file Type list;
CAD data figure layer needs derived CAD diagram layer for storing CAD data, selection;Select CAD diagram layer while need from The data type of the figure layer, label export and the data type for being put in storage the CAD diagram layer are specified in lists of data types, are passed through simultaneously Interface specified database table is used to store the data of specified CAD diagram layer;
In construction module, the CAD data of self-defining data structure storage is the multiple figure layers for specifying similar entity.
4. the system that a kind of CAD data as claimed in claim 3 generates SHAPE data file, characterized in that self-defining data Structure includes storing the point data structure of point data, the polyline data structure for being used to store single polyline data, use of CAD To store the text data structure of single text data and be used to store the face data structure an of face data.
CN201610496317.8A 2016-06-29 2016-06-29 A kind of CAD data generation SHAPE data file method and system Active CN106202239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610496317.8A CN106202239B (en) 2016-06-29 2016-06-29 A kind of CAD data generation SHAPE data file method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610496317.8A CN106202239B (en) 2016-06-29 2016-06-29 A kind of CAD data generation SHAPE data file method and system

Publications (2)

Publication Number Publication Date
CN106202239A CN106202239A (en) 2016-12-07
CN106202239B true CN106202239B (en) 2019-11-12

Family

ID=57462644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610496317.8A Active CN106202239B (en) 2016-06-29 2016-06-29 A kind of CAD data generation SHAPE data file method and system

Country Status (1)

Country Link
CN (1) CN106202239B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026704B (en) * 2019-12-05 2023-11-14 上海维宏电子科技股份有限公司 Method for generating and storing processing of processing tool path information in numerical control system and storage medium thereof
CN112001002B (en) * 2020-07-31 2024-02-20 宁波智讯联科科技有限公司 Method and system for generating product family module by CAD model

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214230A (en) * 2011-06-27 2011-10-12 华东师范大学 Method for setting drainage pipeline network database
CN104281746A (en) * 2014-09-28 2015-01-14 同济大学 Method for generating traffic safety road characteristic graphs on basis of point-cloud

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3831290B2 (en) * 2002-05-07 2006-10-11 株式会社日立製作所 CAD data evaluation method and evaluation apparatus
JP4093802B2 (en) * 2002-06-11 2008-06-04 株式会社リコー CAD data conversion system
JP6468756B2 (en) * 2014-08-25 2019-02-13 株式会社ミツトヨ 3D model generation method, 3D model generation system, and 3D model generation program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214230A (en) * 2011-06-27 2011-10-12 华东师范大学 Method for setting drainage pipeline network database
CN104281746A (en) * 2014-09-28 2015-01-14 同济大学 Method for generating traffic safety road characteristic graphs on basis of point-cloud

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AutoCAD数据转换为SHP文件的新方法;刘朝辉;《信息科技》;20120630(第6期);195-197页 *
在ArcGIS中将cad文件转为shp文件的两种方法;百度经验;《百度经验》;20150317;1-7页 *

Also Published As

Publication number Publication date
CN106202239A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
CN1728138B (en) Method, system, and apparatus for exposing workbooks as data sources
AU2005202285B2 (en) Method, system, and apparatus for providing access to workbook models through remote function calls
EP0483037A2 (en) Remote and batch processing in an object oriented programming system
CN106649503A (en) Query method and system based on sql
CN111506950B (en) BIM structure transformation increment information generation and storage system and method
CN102708203A (en) Database dynamic management method based on XML metadata
US10528855B2 (en) Generating parts with encoded geometry for passively representing information
Rumsey et al. Recent updates to the CFD general notation system (CGNS)
CN106909554A (en) A kind of loading method and device of database text table data
CN106202239B (en) A kind of CAD data generation SHAPE data file method and system
WO2017107130A1 (en) Data query method and database system
CN107103035A (en) This earth's surface data-updating method and device
CN113407565A (en) Cross-database data query method, device and equipment
CN110458285B (en) Data processing method, data processing device, computer equipment and storage medium
CN109858515A (en) The method and system of Order Batch configuration are carried out for the supply chain to intelligence manufacture
CN112000312B (en) Space big data automatic parallel processing method and system based on Kettle and GeoTools
CN107239507A (en) The Intellisense method and system of characteristic in a kind of data desensitization
CN113901120A (en) Method and device for exporting Excel files in large data batch
CN103440325B (en) Operation method of high-efficiency multi-concurrence and auto-adaptation database
Grossman What is analytic infrastructure and why should you care?
Lage Concept oriented design of numerical software
CN103617448A (en) Method for immediately analyzing business data
CN112051987B (en) Service data processing method, device and equipment, program generating method and device
CN112130841B (en) SQL development method and device and terminal equipment
CN102339422A (en) Method and system for modeling service object

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant