Drawing frame serial number labeling method for CAD, terminal equipment and medium

By selecting the clustering points of the graph frame in CAD, using the DBSCAN algorithm for clustering, the graph frame is automatically marked with serial numbers, solving the problem of large workload caused by manual labeling and reordering, and achieving efficient serial numbers of the graph frame.

CN120086910APending Publication Date: 2025-06-03WISDRI WUHAN INFORMATOLOGY ENG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510104271.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

In CAD drawing, the frame number is marked manually and when the frame position changes, it is necessary to reorder, resulting in a large workload for users.

Method used

By selecting a point in the graph box to set it as a clustering point, the coordinates of the clustering points of all graph boxes are extracted, and the DBSCAN algorithm is used for clustering, and the graph box is automatically marked according to the clustering results.

Benefits of technology

Regardless of how the picture frame is placed or proportions, sorting results that conform to the user's design ideas can be automatically generated, improving user efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086910A_ABST
    Figure CN120086910A_ABST
Patent Text Reader

Abstract

The invention relates to a drawing frame serial number labeling method for CAD, terminal equipment and a medium, and the method comprises the steps: selecting a certain point in a drawing frame to be set as a clustering point, and extracting the coordinates of the clustering points of all drawing frames; all the clustering points are clustered according to the size of the y-axis coordinate in the coordinates, and a plurality of clusters are obtained; sorting all the clustering points in each cluster according to a sequence from small to large of the y-axis coordinates of all the clustering clusters in each cluster, and then sorting all the clustering points in each cluster according to a sequence from small to large of the x-axis coordinates; and automatically marking the sequence number of the drawing frame corresponding to each clustering point in the CAD according to the sequence of each sorted clustering point. No matter how the picture frames are placed or how the picture frame proportion is, the sorting result meeting the design thought of the user can be automatically generated, and the efficiency of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of engineering drawing, and particularly to a method for numbering drawing frames for CAD, a terminal device, and a medium. Background Art

[0002] In the field of industrial production (such as steel smelting), it is often necessary to draw structure diagrams or industrial flowcharts through CAD. A large project or system often includes multiple drawings, corresponding to multiple drawing frames in CAD, as Figure 1 shown. When performing CAD drawing, after the designer places the positions of each drawing frame according to their design ideas, numbering is performed on each drawing frame to ensure that when other users read the CAD drawings drawn by the designer later, they can read each drawing frame according to the correct design ideas. The existing method is to manually sort (i.e., manually number), but if there are modifications (such as adding a drawing, deleting a drawing, etc.) after sorting, re-sorting is required, which will greatly increase the workload of users. Summary of the Invention

[0003] To solve the above problems, the present invention proposes a method for numbering drawing frames for CAD, a terminal device, and a medium.

[0004] The specific solutions are as follows:

[0005] A method for numbering drawing frames for CAD, comprising the following steps:

[0006] S1: Select a certain point in the drawing frame as the clustering point, and extract the coordinates of the clustering points of all drawing frames;

[0007] S2: Cluster all clustering points according to the magnitude of the y-axis coordinates in the coordinates to obtain multiple clusters;

[0008] S3: After sorting each cluster in ascending order of the y-axis coordinates of all clustering clusters within it, sort all clustering points within each cluster in ascending order of the x-axis coordinates;

[0009] S4: Automatically number the serial numbers of the drawing frames corresponding to each clustering point in CAD according to the order of the sorted clustering points.

[0010] Further, the clustering point is default set as the lower right corner point of the drawing frame.

[0011] Further, the DBSCAN algorithm is used for clustering.

[0012] Further, the neighborhood radius in the DBSCAN algorithm is a multiple of the y-axis length corresponding to the drawing frame with the smallest y-axis distance in the actual CAD drawing frame, and the value range of the multiple is 0-1.

[0013] A terminal device for numbering the drawing frames in CAD, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method described above in the embodiments of the present invention are implemented.

[0014] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described above in the embodiments of the present invention are implemented.

[0015] Adopting the above technical solution, the present invention can automatically generate a sorting result that conforms to the user's design idea regardless of how the drawing frames are placed and what the drawing frame ratio is, improving the user's efficiency. Description of the Drawings

[0016] Figure 1 Shown is a schematic diagram of each drawing frame in CAD.

[0017] Figure 2 Shown is a flowchart of the method in Embodiment 1 of the present invention.

[0018] Figure 3 Shown is a schematic diagram of the serial number setting method in this embodiment. Detailed Embodiments

[0019] To further illustrate the embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, mainly used to illustrate the embodiments, and can be combined with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention.

[0020] The present invention will be further described below in conjunction with the drawings and specific embodiments.

[0021] Embodiment 1:

[0022] The embodiment of the present invention provides a method for numbering the drawing frames in CAD, as Figure 2 shown, the method includes the following steps:

[0023] S1: Select a certain point in the drawing frame as the clustering point, and extract the coordinates of the clustering points of all the drawing frames.

[0024] In this embodiment, the clustering point is default set as the lower right corner point of the drawing frame. In other embodiments, it can also be set as a point at other positions, such as any vertex or center point of the drawing frame, which is not limited herein.

[0025] S2: Cluster all the clustering points according to the magnitude of the y-axis coordinates in the coordinates to obtain multiple clusters.

[0026] In the CAD drawing software, the y-axis is the vertical direction and the x-axis is the horizontal direction. Clustering based on the magnitude of the y-axis coordinates means dividing all the icons into multiple rows in the vertical direction first, with each cluster corresponding to one row.

[0027] Clustering algorithms include distance-based clustering algorithms, hierarchical clustering algorithms, density-based clustering algorithms, etc. In this embodiment, since the number of categories (clusters) to be finally obtained does not need to be considered, the density-based clustering algorithm DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is preferably used. Its main idea is that a cluster is composed of a region with a sufficiently high density, and this region is a dense region connected by core objects. DBSCAN defines a cluster as a region with a sufficiently high density and separates the cluster from adjacent density regions through noise points.

[0028] In the clustering algorithm, it is necessary to determine the neighborhood radius R and the minimum number of points minpoints. When the number of points within the neighborhood radius R is greater than the minimum number of points minpoints, it is dense. In this embodiment, the neighborhood radius R is set to a multiple of the y-axis length corresponding to the smallest drawing frame in the y-axis distance (i.e., the height of the drawing frame) in the actual CAD drawing frame. This multiple can be set according to requirements, and the value range is 0 - 1.

[0029] S3: After sorting each cluster in ascending order of the y-axis coordinates of all the clustering clusters within it, sort all the clustering points within each cluster in ascending order of the x-axis coordinates.

[0030] According to the above sorting method, take the clustering points of the same cluster as one row. The clustering points of the first row are arranged before the clustering points of the second row, the clustering points of the second row are arranged before the clustering points of the third row, and so on.

[0031] S4: Automatically label the serial numbers of the drawing frames corresponding to each clustering point in CAD according to the order of the sorted clustering points.

[0032] In this embodiment, during the annotation, set the serial number of the drawing frame sorted as 1 to 1, set the serial number of the drawing frame sorted as 2 to 2, and so on.

[0033] In CAD drawing, the serial numbers of each drawing frame can be set to different field contents according to actual application requirements. For example, they can be set to Figure 3 the page number field as shown.

[0034] When the numbering of each drawing frame is completed by the above method, when performing PDF printing on the CAD drawing, the document name of the PDF document corresponding to each drawing frame is generated based on the number of each drawing frame, and then all the drawing frames are merged after sorting based on the document name to obtain a document sorted by number.

[0035] Embodiment 2:

[0036] The present invention also provides a terminal device for numbering drawing frames in CAD, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above method embodiment of Embodiment 1 of the present invention are implemented.

[0037] Further, as an executable solution, the terminal device for numbering drawing frames in CAD may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The terminal device for numbering drawing frames in CAD may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above composition structure of the terminal device for numbering drawing frames in CAD is only an example of the terminal device for numbering drawing frames in CAD, and does not constitute a limitation on the terminal device for numbering drawing frames in CAD. It may include more or fewer components than the above, or combine some components, or different components. For example, the terminal device for numbering drawing frames in CAD may also include input and output devices, network access devices, buses, etc. The present invention embodiment does not make a limitation on this.

[0038] Further, as an executable solution, the so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the terminal device for numbering drawing frames in CAD, and connects various parts of the entire terminal device for numbering drawing frames in CAD through various interfaces and lines.

[0039] The memory can be used to store the computer programs and / or modules. By running or executing the computer programs and / or modules stored in the memory, and by calling the data stored in the memory, the processor can implement various functions of the terminal device for frame serial number annotation in CAD. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system and application programs required for at least one function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as hard disks, memory, plug-in hard disks, smart media cards (SMCs), secure digital (SD) cards, flash cards, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

[0040] The present invention also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the method in the above embodiments of the present invention are implemented.

[0041] If the modules / units integrated in the terminal device for frame serial number annotation in CAD are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above embodiments of the present invention, it can also be completed by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution medium, etc.

[0042] Although the present invention is specifically shown and described in conjunction with the preferred embodiments, those skilled in the art should understand that various changes can be made to the present invention in terms of form and details without departing from the spirit and scope of the present invention defined by the appended claims, and all of them are within the protection scope of the present invention.

Claims

1. A method for marking frame numbers in CAD, characterized in that: The following steps are involved: S1: Select a point in the frame and set it as a cluster point, and extract the coordinates of the cluster points of all frames; S2: Cluster all cluster points according to the size of the y-axis coordinates in the coordinates to obtain multiple clusters; S3: After sorting each cluster in the ascending order of the y-axis coordinates of all clusters in it, sort all cluster points in each cluster in the ascending order of the x-axis coordinates; S4: Automatically mark the serial number of the drawing frame corresponding to each cluster point in CAD according to the order of the sorted cluster points.

2. The method for marking frame numbers for CAD according to claim 1, characterized in that: The cluster point is set to the lower right corner of the frame by default.

3. The method for marking frame numbers for CAD according to claim 1, characterized in that: The DBSCAN algorithm is used for clustering.

4. The method for marking frame numbers for CAD according to claim 3, characterized in that: The neighborhood radius in the DBSCAN algorithm uses the multiple of the y-axis length corresponding to the frame with the smallest y-axis distance in the actual CAD frame, and the value range of the multiple is 0-1.

5. A terminal device for marking frame serial numbers for CAD, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 4 when executing the computer program.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.