CN115186312A - Method for automatically generating cable pipe-burying section view through CAD - Google Patents
Method for automatically generating cable pipe-burying section view through CAD Download PDFInfo
- Publication number
- CN115186312A CN115186312A CN202210583846.7A CN202210583846A CN115186312A CN 115186312 A CN115186312 A CN 115186312A CN 202210583846 A CN202210583846 A CN 202210583846A CN 115186312 A CN115186312 A CN 115186312A
- Authority
- CN
- China
- Prior art keywords
- cable
- buried pipe
- pipe
- information data
- cad
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/10—Geometric CAD
Abstract
The invention discloses a method for automatically generating a cable buried pipe section view by a computer-aided design (CAD), and relates to the field of CAD graph generation methods. In the power design industry, the traditional drawing of the cable buried pipe section view needs manual calculation and drawing operation, the workload is large, the efficiency is low, and the accuracy is greatly influenced by human factors. The method comprises reading the drawing number in the cable pipe burying information data and storing the drawing number in a set; drawing numbers are extracted from the set, and drawings are opened; detecting the pipe burying information data of the drawing number; calculating the center coordinates of each buried pipe section according to the buried pipe information data, and storing the coordinates in a container; extracting inserted buried pipe information data according to the drawing number; and drawing the buried pipe according to the coordinates of each circle center and the buried pipe information data, and packaging the drawn graph into blocks for storage. The method can conveniently, quickly and accurately automatically generate the cable buried pipe section views in batches, reduce the drawing workload, and effectively avoid a large amount of repeated manual calculation and operation.
Description
Technical Field
The invention relates to the field of CAD graph generation methods, in particular to a method for automatically generating a cable buried pipe section view through CAD.
Background
At present, in the power design industry, drawing work of design drawings is mainly completed through CAD software. In the process of drawing the cable pipe-burying section map, a great deal of energy is consumed by designers to arrange the section of the pipe arrangement because the number of the cable pipes is large, and because the number of drawings related to the cable pipe-burying section map is large, the manual hand-drawing of the section map is not only inefficient, but also the correctness is greatly influenced by human factors. At present, various CAD software basically has a secondary development function, but no professional auxiliary tool suitable for drawing the buried pipe sectional view of the power cable exists.
Disclosure of Invention
The technical problem to be solved and the technical task to be solved by the invention are to perfect and improve the prior technical scheme, and provide a method for automatically generating a cable tube-embedded section view by CAD, aiming at quickly and accurately generating the cable tube-embedded section view and reducing the drawing workload. Therefore, the invention adopts the following technical scheme.
A CAD method for automatically generating a cable tube-embedding section view comprises the following steps:
1) Reading a drawing number in the cable pipe burying information data and storing the drawing number into a set;
2) Drawing numbers are extracted from the set, and drawings are opened;
3) Detecting the pipe burying information data of the drawing number;
4) Calculating the center coordinates of each buried pipe section according to the buried pipe information data, and storing the coordinates in a container;
5) Extracting inserted buried pipe information data according to the drawing number;
6) Drawing the buried pipe according to the coordinates of each circle center and the buried pipe information data, and packaging the drawn graph into blocks for storage;
7) And detecting whether the drawing is the last drawing in the set, if so, ending, otherwise, returning to the step 2) to read the next drawing number. The method can conveniently, quickly and accurately automatically generate the cable tube burying section maps in batches, reduce the drawing workload, effectively avoid a large amount of repeated manual calculation and operation, and integrally improve the working efficiency of drawing design and improve the working quality compared with the traditional mode of manually drawing the cable tube arranging section maps one by one.
As a preferable technical means: in the step 1), the cable pipe burying information data adopts Excel table data, and a cable pipe burying sequence number num is stored in the Excel table to distinguish each pipe burying section, wherein the pipe burying sequence number num corresponds to the outer diameter R and the inner diameter R of a buried pipe, and the pipe burying arrangement mode is a row and b column. And an Excel table mode is adopted, so that the maintenance is convenient.
As a preferable technical means: after traversing and reading data such as cable pipe burying sequence numbers num, outer diameters R, inner diameters R, arrangement modes a rows and b columns of all buried pipes in the Excel table, correspondingly creating objects Object = { num, R, R, a and b } according to the read data of the cable pipe burying information, and sequentially storing the objects in a container. And acquiring buried pipe information data.
As a preferable technical means: the step 4) comprises the following steps:
401 Traversing Object objects stored in the container and storing the buried pipe information data;
402 Each Object forms a section drawing, and a container is created for each section drawing to store the coordinates of the center of a circle of each row of tubes in the drawing;
403 According to the row and column information data of the buried pipes stored in the Object, the center coordinates of each buried pipe are calculated by combining a buried pipe spacing calculation formula and stored in a container. And calculating the coordinates of the circle center through the information data of the buried pipe.
As a preferable technical means: step 6) comprises the following steps:
601 Traverse the container stored with the coordinates of the center of the buried pipe;
602 Obtaining the outer diameter R and the inner diameter R of the buried pipe in the current section from the Object;
603 Call a circle drawing function, and input circle center coordinates (x, y), an outer diameter R and an inner diameter R;
604 The well-drawn buried pipe section figure is written into a CAD block through a packaging function and is exported. Automatically generating a buried pipe section pattern.
As a preferable technical means: in step 7), the method for detecting whether the drawing is the last drawing in the set is to continue detecting and accessing the next Object in the Object container in a traversal manner, and process a next section until the traversal is completed.
As a preferable technical means: and a Python programming language is adopted, and a cable pipe-burying section is automatically generated based on the secondary development of a pyautocad library. Compared with the traditional CAD software secondary development language, the Python programming language is simpler and more convenient to learn, and is easy to understand, develop and apply.
As a preferable technical means: the container is a list container, has the function of recording the sequence of storing the objects into the container, and can find the corresponding Object according to the value of the num variable in the Object.
As a preferable technical means: and the distance calculation formula of the buried pipes is that the distance d =2R +50 between the centers of circles of the adjacent buried pipes. The distance unit is mm, and the buried pipe distance calculation is realized.
Has the advantages that: according to the method, the CAD software is developed for the second time, the cable buried pipe section maps can be generated conveniently, rapidly and accurately in batches automatically, the drawing workload is reduced, a large amount of repeated manual calculation and operation can be effectively eliminated, compared with the traditional mode of manually drawing the cable arrangement pipe section maps one by one, the method can convert the large amount of repeated operation from manual drawing to automatic completion by a computer, and after a designer inputs the requirement of the number of the arrangement pipes of each section drawing, the batch drawing of the cable buried pipe section maps can be completed automatically, the working efficiency of drawing design is improved integrally, and the working quality is improved.
Drawings
FIG. 1 is a schematic flow diagram of the present invention.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the drawings in the specification.
As shown in fig. 1, a CAD automatic generation method of a cable tube-embedding section includes the following steps:
s1) reading a drawing number in cable buried pipe information data in an EXCEL table and storing the drawing number into a set;
s2) drawing numbers are extracted from the set, and drawings are opened;
s3) detecting the pipe burying information data of the drawing number;
s4) calculating the circle center coordinate of each buried pipe section according to the buried pipe information data, and storing the coordinate in a container;
s5) extracting inserted buried pipe information data according to the drawing number;
s6) drawing buried pipes according to the coordinates of the circle centers and buried pipe information data, and packaging the drawn graphs into blocks for storage;
and S7) detecting whether the drawing is the last drawing in the set, if so, ending, otherwise, returning to the step 2) to read the next drawing number.
In the step S1), the cable pipe burying information data adopts Excel table maintenance data, cable pipe burying sequence numbers num are stored in the Excel table to distinguish various pipe burying section views, the pipe burying sequence numbers num correspond to the outer diameter R and the inner diameter R of buried pipes, and the pipe burying mode is a row and b columns. And an Excel table mode is adopted, so that the maintenance is convenient.
In the step S3), after traversing and reading data of cable pipe burying serial numbers num, outer diameters R, inner diameters R, arrangement modes a rows and b columns and the like of all buried pipes in the Excel table, correspondingly creating objects Object = { num, R, a, b } according to the read data of the cable pipe burying information, and sequentially storing the objects in a container. And acquiring buried pipe information data.
Step S4) includes the steps of:
s401) traversing Object objects stored in the container and storing the buried pipe information data;
s402) forming a section drawing for each Object, and creating a container for each section drawing to store the center coordinates of each row of tubes in the drawing;
s403) according to the buried pipe row and column information data stored in the Object, calculating the circle center coordinate of each buried pipe by combining a buried pipe spacing calculation formula, and storing the circle center coordinate in a container for storage. And calculating the coordinates of the circle center through the information data of the buried pipe.
Step S6) includes the steps of:
s601) traversing the container stored with the coordinates of the circle center of the buried pipe;
s602) acquiring the outer diameter R and the inner diameter R of the buried pipe in the current section from the Object;
s603) calling a circular drawing function, and inputting circle center coordinates (x, y), an outer diameter R and an inner diameter R;
s604), writing the drawn buried pipe profile graph into a CAD block through a packaging function and exporting the CAD block. Automatically generating a buried pipe section pattern.
In step S7), the method for detecting whether the drawing is the last drawing in the set is to continue detecting and accessing the next Object in the Object container in a traversal manner, and process a next section until the traversal is completed.
The container is a list container, has a function of recording the order of storing the objects into the container, and can find the corresponding Object according to the value of the num variable in the Object.
And the distance calculation formula of the buried pipes is that the distance d =2R +50 between the centers of circles of the adjacent buried pipes. And realizing the calculation of the spacing between the buried pipes.
In order to reduce the difficulty of learning and development, a Python programming language is adopted, and a cable pipe-burying section is automatically generated based on the secondary development of a pyautocad library. Compared with the traditional secondary development language of CAD software, the learning of the Python programming language is simpler and more convenient, and the development and application are easy.
The core of automatically generating the cable buried pipe section view lies in positioning the circle center position of each buried pipe, the coordinate position of each buried pipe can be calculated according to cable buried pipe information, the distance between the buried pipes needs to be manually calculated in daily work, and then the coordinates are positioned for drawing.
The above method for CAD automatic generation of cable tube profile as shown in fig. 1 is a specific embodiment of the present invention, and it is within the scope of the present invention to embody the outstanding substantial features and significant advantages of the present invention, and to modify the shape, structure, etc. of the cable tube profile according to the practical use requirements and with the teaching of the present invention.
Claims (9)
1. A CAD method for automatically generating a cable tube-embedding section view is characterized by comprising the following steps:
1) Reading a drawing number in the cable pipe burying information data and storing the drawing number into a set;
2) Drawing numbers are extracted from the set, and drawings are opened;
3) Detecting the pipe burying information data of the drawing number;
4) Calculating the center coordinates of each buried pipe section according to the buried pipe information data, and storing the coordinates in a container;
5) Extracting inserted buried pipe information data according to the drawing number;
6) Drawing the buried pipe according to the coordinates of each circle center and the buried pipe information data, and packaging the drawn graph into blocks for storage;
7) And detecting whether the drawing is the last drawing in the set, if so, ending, otherwise, returning to the step 2) to read the next drawing number.
2. The CAD automatic generation cable embedding sectional view method as claimed in claim 1, wherein: in the step 1), the cable pipe burying information data adopts Excel table data, a cable pipe burying sequence number num is stored in the Excel table to distinguish each pipe burying section, the pipe burying sequence number num corresponds to the outer diameter R and the inner diameter R of a buried pipe, and the pipe burying mode is a row and b columns.
3. The CAD automatic generation cable embedding sectional view method as claimed in claim 2, wherein: after traversing and reading data of cable pipe burying serial numbers num, outer diameters R, inner diameters R, arrangement modes a rows and b columns and the like of all buried pipes in the Excel table, correspondingly creating objects Object = { num, R, R, a, b } according to the read data of the cable pipe burying information, and sequentially storing the objects into a container.
4. The CAD method for automatically generating a cable tube-embedding section view of claim 3, wherein: the step 4) comprises the following steps:
401 Traversing Object objects stored in the container and storing the buried pipe information data;
402 Each Object forms a section drawing, and a container is created for each section drawing to store the coordinates of the center of each row of tubes in the drawing;
403 According to the row and column information data of the buried pipes stored in the Object, the center coordinates of each buried pipe are calculated by combining a buried pipe spacing calculation formula and stored in a container.
5. The CAD method for automatically generating a cable tube-embedding section view of claim 4, wherein: step 6) comprises the following steps:
601 Traverse the container stored with the coordinates of the center of the buried pipe;
602 Obtaining the outer diameter R and the inner diameter R of the buried pipe in the current section from the Object;
603 Call a circle drawing function, and input circle center coordinates (x, y), an outer diameter R and an inner diameter R;
604 The well-drawn section graph of the buried pipe is written into a CAD block through a packaging function and is exported.
6. The CAD method for automatically generating a cable tube-embedding section view of claim 5, wherein: in step 7), the method for detecting whether the drawing is the last drawing in the set is to continue detecting and accessing the next Object in the Object container in a traversal manner, and process a next section until the traversal is completed.
7. The CAD method for automatically generating a cable tube-embedding section view of claim 6, wherein: and a Python programming language is adopted, and a cable pipe-burying section is automatically generated based on the secondary development of a pyautocad library.
8. The method for automatically generating the cable embedding pipe section view through CAD according to claim 7, characterized in that: the container is a list container, has the function of recording the sequence of storing the objects into the container, and can find the corresponding Object according to the value of the num variable in the Object.
9. The method for automatically generating the cable embedding pipe section view through CAD according to claim 8, characterized in that: and the distance calculation formula of the buried pipes is that the distance d =2R +50 between the centers of circles of the adjacent buried pipes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210583846.7A CN115186312A (en) | 2022-05-27 | 2022-05-27 | Method for automatically generating cable pipe-burying section view through CAD |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210583846.7A CN115186312A (en) | 2022-05-27 | 2022-05-27 | Method for automatically generating cable pipe-burying section view through CAD |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115186312A true CN115186312A (en) | 2022-10-14 |
Family
ID=83513459
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210583846.7A Pending CN115186312A (en) | 2022-05-27 | 2022-05-27 | Method for automatically generating cable pipe-burying section view through CAD |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115186312A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116611131A (en) * | 2023-07-05 | 2023-08-18 | 大家智合(北京)网络科技股份有限公司 | Automatic generation method, device, medium and equipment for packaging graphics |
-
2022
- 2022-05-27 CN CN202210583846.7A patent/CN115186312A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116611131A (en) * | 2023-07-05 | 2023-08-18 | 大家智合(北京)网络科技股份有限公司 | Automatic generation method, device, medium and equipment for packaging graphics |
CN116611131B (en) * | 2023-07-05 | 2023-12-26 | 大家智合(北京)网络科技股份有限公司 | Automatic generation method, device, medium and equipment for packaging graphics |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109191576B (en) | Layer classification method for converting building drawings into three-dimensional BIM (building information modeling) models | |
CN110625615B (en) | Robot off-line programming information processing system and method | |
CN113094784B (en) | Adjacent complex underground engineering parametric modeling method based on building information model | |
CN103488838B (en) | A kind of waste heat boiler pipeline area of computer aided goes out drawing method | |
CN115186312A (en) | Method for automatically generating cable pipe-burying section view through CAD | |
CN113326558B (en) | Rapid drawing method for detailed diagrams of parameterized doors and windows based on Grasshopper platform secondary development | |
CN110109999B (en) | System for converting SMART3D three-dimensional model into FlowMaster model and conversion method | |
CN115222873B (en) | Three-dimensional property map attribute batch association method based on labels and spatial semantics | |
CN110765516B (en) | Indoor wiring method for railway signals | |
CN112100296B (en) | GIS system convenient to carry out GIS vector data editing | |
CN107291045B (en) | Workshop programming system | |
CN109766601B (en) | Computer aided drawing method and device for electric piping | |
CN110826185A (en) | Method for establishing bearing part library based on CAD secondary development | |
CN114833461B (en) | Free steering method and sorting device for non-closed contour of laser cutting path | |
CN116227055A (en) | Intelligent design method and system for water chilling unit | |
CN114091135A (en) | Lisp language-based ship body curved surface outer plate weight gravity center calculation program | |
CN110110024B (en) | Method for importing high-capacity VCT file into spatial database | |
CN107240150A (en) | A kind of three-dimensional tube numeral dissolves drawing method | |
CN103605849A (en) | Implementation method for linkage computing in product design analysis and development environment | |
CN114090611A (en) | Method and device for generating cable inventory by terminal wiring table and electronic equipment | |
CN109388889B (en) | Method for establishing parameterized prestressed pipe bundle group | |
CN112464402B (en) | Automatic pipeline batching method based on E3D software | |
Abdullayev | Algorithmically and programming management of designing process of flexible manufacture system | |
CN111723432B (en) | Method for rapidly extracting accurate oil mass CAD model of aircraft oil tank | |
CN111913697B (en) | Method for batch screening of point record information based on ArcGIS |
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 |