CN116595602B - CAD block cleaning method and device, electronic equipment and storage medium - Google Patents

CAD block cleaning method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116595602B
CN116595602B CN202310869713.0A CN202310869713A CN116595602B CN 116595602 B CN116595602 B CN 116595602B CN 202310869713 A CN202310869713 A CN 202310869713A CN 116595602 B CN116595602 B CN 116595602B
Authority
CN
China
Prior art keywords
block
block definition
definition
target
node
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
CN202310869713.0A
Other languages
Chinese (zh)
Other versions
CN116595602A (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.)
Nuclear Industry Research And Engineering Co ltd
China Nuclear Industry 23 Construction Co Ltd
Original Assignee
Nuclear Industry Research And Engineering Co ltd
China Nuclear Industry 23 Construction 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 Nuclear Industry Research And Engineering Co ltd, China Nuclear Industry 23 Construction Co Ltd filed Critical Nuclear Industry Research And Engineering Co ltd
Priority to CN202310869713.0A priority Critical patent/CN116595602B/en
Publication of CN116595602A publication Critical patent/CN116595602A/en
Application granted granted Critical
Publication of CN116595602B publication Critical patent/CN116595602B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/20Configuration CAD, e.g. designing by assembling or positioning modules selected from libraries of predesigned modules

Abstract

The application relates to the technical field of engineering design, and provides a block cleaning method and device of CAD (computer aided design), electronic equipment and a storage medium, wherein a drawing file and a block definition cleaning plug-in are loaded on a CAD tool; the method comprises the following steps: responding to an opening operation for a target drawing file, and displaying a CAD image corresponding to the target drawing file; loading a block reference in the CAD image; and deleting the target block reference in the CAD image in response to a deleting operation for the target block reference. According to the method provided by the application, after the target block in the CAD image is deleted and referred, the block definition to be cleaned is deleted based on the block definition tree diagram, and the nesting relation among the block definitions can be clearly known through the block definition tree diagram, so that the difficulty of cleaning the block definition is reduced, the cleaning efficiency is improved, and the thorough cleaning of the target block is realized.

Description

CAD block cleaning method and device, electronic equipment and storage medium
Technical Field
The application relates to the technical field of engineering design, in particular to a block cleaning method and device for CAD, electronic equipment and storage medium.
Background
In the industries of chemical engineering, construction and the like, a drawing is a file which is drawn by CAD software and used for describing a process flow and a building diagram. "Block" is a drawing term that refers to the combination of commonly used pipe and part graphics into a single unit, and the rapid addition of parts to the drawing by way of inserted blocks during the later drawing process. A block definition is a template, and a block reference is an example of a block definition, and based on one block definition, a user can insert multiple block references into a drawing. The created blocks can also be divided into two types, a normal block and a nested block according to the habit of the plotter. The common block is formed by adding necessary basic primitives from blank to each block definition created. The common blocks are relatively independent, and no nesting and dependency relationship exists.
The cleaning of a common block is relatively simple, and only all block references defined based on the block need to be cleaned in the drawing, and then cleaned in a cleaning dialog box. However, the cleaning of the nested block requires cleaning all block references in the drawing and then cleaning the block definition as a block reference, while also ensuring that the nested block is not nested by other blocks.
In the prior art, a drawing often comprises a great deal of content, the nesting relation of blocks is complicated, and the relation among all nested blocks or block definitions cannot be clearly displayed, so that the blocks in the drawing cannot be cleaned, and the block cleaning operation cannot be smoothly performed.
Disclosure of Invention
In view of the above, the present application aims to provide a method and apparatus for cleaning a CAD block, an electronic device, and a storage medium.
In a first aspect, an embodiment of the present application provides a method for cleaning a block of a CAD, where the method is applied to a CAD tool, and the CAD tool is loaded with a drawing file and a block definition cleaning plug-in; the method comprises the following steps:
responding to an opening operation for a target drawing file, and displaying a CAD image corresponding to the target drawing file; loading a block reference in the CAD image;
deleting the target block reference in the CAD image in response to a deletion operation for the target block reference;
responding to the opening operation of the block definition cleaning plugin and the block definition cleaning auxiliary triggering operation, and generating and displaying a block definition tree diagram corresponding to the CAD image; the block definition tree diagram comprises a root node block definition and a child node block definition under the root node block;
and responding to the deleting operation defined by the target node block based on the block definition tree diagram.
With reference to the first aspect, the step of generating and displaying the block definition tree diagram corresponding to the CAD image includes:
traversing the block definition corresponding to the block reference in the target drawing file;
judging whether other block definitions are contained in the block definitions or not according to each block definition;
if yes, traversing the child node marking the block definition as the other block definition;
if not, marking the block definition as a root node;
based on the root node and the child nodes, a block definition tree graph is generated.
With reference to the first aspect, the step of responding to the deletion operation defined by the target node block based on the block definition tree graph includes:
responding to selected operation and deleting operation aiming at a target node block definition in a block definition tree diagram, and acquiring a node type corresponding to the target node block definition;
and executing corresponding deleting operation according to the node type defined by the target node block.
With reference to the first aspect, the CAD tool further includes a block definition list for storing the block definitions; and executing corresponding deleting operation according to the node type defined by the target node block, wherein the deleting operation comprises the following steps:
if the node type of the target node block definition is a child node, deleting the target node block definition and updating the block definition list;
if the node type of the target node block definition is a root node, judging whether a child node block definition exists under the target node block definition, if so, displaying prompt information that the target node block definition has a reference and cannot be deleted; and if not, deleting the block definition corresponding to the target node block definition and updating the block definition list.
With reference to the first aspect, the step of responding to the deletion operation defined by the target node block based on the block definition tree graph includes:
responding to the touch operation of the second designated key, and displaying a cleanable item list corresponding to the CAD image in the block definition cleaning plug-in;
marking a target block definition as a selected state in response to a selection operation for the target block definition;
and deleting the target block definition in response to the touch operation aiming at the third designated key.
With reference to the first aspect, the CAD tool further includes a block editor, and the method further includes:
adding one or more block references at a block editing interface in response to a touch operation for the block editor;
for each block reference, responding to attribute triggering operation for the block reference, and displaying an attribute editing interface corresponding to the block reference; a style editing option is arranged in the attribute editing interface;
responding to the editing operation or the selecting operation aiming at the style editing options, and adjusting the corresponding attribute of the block reference;
and storing the block references in the block definition list in response to a save operation for the block references, and displaying the block definitions in the block definition list.
In combination with the first aspect, the block definition cleaning assistance triggering operation includes a touch operation on a specified key or a touch operation on a specified control.
In a second aspect, the present application provides a block cleaning device for CAD, the device being applied to a CAD tool loaded with a drawing file and a block definition cleaning plug-in; the device comprises:
the image display module is used for responding to the opening operation of the target drawing file and displaying the CAD image corresponding to the target drawing file; loading a block reference in the CAD image;
a target block reference deleting module, configured to delete a target block reference in the CAD image in response to a deleting operation for the target reference;
the tree diagram generation and display module is used for responding to the starting operation of the block definition cleaning plug-in and the block definition cleaning auxiliary triggering operation and generating and displaying a block definition tree diagram corresponding to the CAD image; the block definition tree graph comprises a root node block and a child node block under the root node block;
and the deleting module is used for responding to the deleting operation defined by the target node block based on the block definition tree diagram.
In a third aspect, the present application provides an electronic device comprising a processor and a memory, the memory having stored therein a computer program for execution by the processor to implement the method described above.
In a fourth aspect, the present application provides a storage medium having a computer program stored therein, the computer program being executed by a processor to implement the method described above.
The embodiment of the application has the following beneficial effects: the application provides a block cleaning method and device for CAD (computer aided design), electronic equipment and a storage medium, wherein a drawing file and a block definition cleaning plug-in are loaded on a CAD tool; the method comprises the following steps: responding to an opening operation for a target drawing file, and displaying a CAD image corresponding to the target drawing file; loading a block reference in the CAD image; deleting the target block reference in the CAD image in response to a deletion operation for the target block reference; responding to the opening operation of the block definition cleaning plugin and the block definition cleaning auxiliary triggering operation, and generating and displaying a block definition tree diagram corresponding to the CAD image; the block definition tree diagram comprises a root node block definition and a child node block definition under the root node block; and responding to the deleting operation defined by the target node block based on the block definition tree diagram. According to the method provided by the application, after the target block in the CAD image is deleted and referred, the block definition to be cleaned is deleted based on the block definition tree diagram, and the nesting relation among the block definitions can be clearly known through the block definition tree diagram, so that the difficulty of cleaning the block definition is reduced, the cleaning efficiency is improved, and the thorough cleaning of the target block is realized.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the application and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for cleaning a block of CAD according to embodiment 1 of the present application;
fig. 2 is an exemplary diagram of a nesting relationship between block definitions in a target drawing file in a block cleaning method of CAD according to an embodiment of the present application;
FIG. 3 is an exemplary diagram of a block definition tree diagram corresponding to a target drawing file in a block cleaning method of CAD according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a block cleaning device of a CAD according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Reference numerals:
a 10-image display module, a 20-target block reference deletion module, a 30-tree diagram generation display module and a 40-deletion module.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In order to facilitate understanding of the present embodiment, technical terms designed by the present application will be briefly described below.
"Block" is a drawing term that refers to the combination of commonly used pipe and part graphics into a whole, and the common operations of quickly adding part blocks to a drawing by inserting blocks during the subsequent drawing process mainly include: creation of block definitions, insertion of block references, cleaning of blocks.
The created blocks can also be divided into two types, a normal block and a nested block according to the habit of the plotter. The common block is formed by adding necessary basic primitives from blank to each block definition created. The common blocks are relatively independent, and no nesting and dependency relationship exists. The cleaning of a common block is relatively simple, and all block references defined based on the block need only be deleted in the drawing, and then cleaned in a "clean" dialog box. By nested block, it is meant that when a block is created, the contents of that block are not just the base primitive, but also include other blocks, which already form "there are blocks in the block".
After technical terms related to the application are introduced, application scenes and design ideas of the embodiment of the application are briefly introduced.
The cleaning of the nested blocks needs to clean all block references in the drawing and then clean the block definitions used as the block references, and meanwhile, the nested blocks are required to be ensured not to be nested by other blocks, while one drawing in the prior art often comprises a great deal of contents, the nested relation of the blocks is complicated, the relation among the nested blocks or the block definitions cannot be clearly displayed, and the blocks existing in the drawing cannot be cleaned, so that the block cleaning operation cannot be smoothly performed.
Based on the above, the embodiment of the application provides a method and a device for cleaning a block of a CAD, an electronic device and a storage medium, wherein the method for cleaning the block of the CAD is applied to a CAD tool, the CAD tool comprises a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the method for cleaning the block of the CAD provided by the embodiment of the application.
Example 1
The embodiment provides a block cleaning method of CAD, which is applied to CAD tools loaded with drawing files and block definition cleaning plug-ins. Referring to fig. 1, the method provided in this embodiment includes the following steps:
s110, the processor responds to the opening operation for the target drawing file and displays a CAD image corresponding to the target drawing file; the CAD image is loaded with block references.
S120, the processor responds to the deleting operation for the target block reference to delete the target block reference in the CAD image.
S130, the processor responds to the starting operation of the block definition cleaning plug-in and the block definition cleaning auxiliary triggering operation to generate and display a block definition tree diagram corresponding to the CAD image; the block definition tree diagram comprises a root node block definition and a child node block definition under the root node block.
S140, the processor responds to the deleting operation defined by the target node block based on the block definition tree diagram.
In this embodiment, when a user opens a block definition cleaning plug-in and triggers a block cleaning operation, a block definition tree diagram corresponding to a CAD image is generated and displayed, where the block definition tree diagram includes a root node block and a child node block under the root node block, and the block definition tree diagram is used to display a nesting relationship between the block definitions, so that the user can know the nesting relationship between the blocks, so that the user can thoroughly understand the blocks in a complex drawing file.
In the engineering drawing process, the CAD image contains thousands of part patterns, when the image block formed by simple lines is reused, the original image block needs to be copied to a designated position, and the lines are easy to miss or select in the copying process, so that the error rate is high. In order to reduce the error rate and improve the drawing convenience and drawing efficiency, a block formed by certain lines is generally created as a block definition, so that the block is defined as a whole, and the operation of reinserting the whole block for use or copy pasting is performed, so that the drawing efficiency is greatly improved.
However, when a drawing engineer wants to delete a block definition in the face of drawings drawn by others or drawings with a lot of block definitions, because there may be a nesting relationship between each block definition, the block definition to be cleaned cannot be cleaned when being referred to by other block definitions, and when the block definition cleaning plug-in this embodiment is started and triggers a block cleaning auxiliary operation, a block definition tree diagram corresponding to a CAD image is generated and displayed, so that the nesting relationship between each block definition is clear, and the block definition cleaning work is facilitated to be smoothly performed.
With reference to the first aspect, step S120 includes the steps of generating and displaying a block definition tree diagram corresponding to the CAD image, where the step includes:
the blocks in the traversal target drawing file refer to the corresponding block definitions.
For each block definition, it is determined whether other block definitions are included in the block definition.
If so, traversing the child node marking the block definition as the other block definition.
If not, marking the block definition as a root node.
Based on the root node and the child nodes, a block definition tree graph is generated.
Firstly, traversing block references in a target drawing file, acquiring block definitions corresponding to the block references, and then defining whether recursive traversal contains other block definitions for each block, thereby forming a block definition tree diagram.
For example, the block references present in the target drawing file are: valve, stop valve, ball valve, manual control ball valve (as shown in figure 2), wherein the stop valve block definition is a block definition added with straight line preservation on the basis of the valve block definition; the ball valve block definition is a block definition stored after a circle is added on the basis of the valve block definition; the manual control ball valve block definition is a block definition stored after adding a straight line on the basis of the ball valve block definition.
Traversing block definition in a drawing by adopting the following codes and constructing a block definition tree diagram:
private static void GetAllBlocks()
{
foreach (ZWCAD.ZcadBlock B in doc.Blocks)
{
if (!B.IsLayout)
{
Console.WriteLine(B.Name);
LoopBlock (B); and/or recursive traversal
}
}
}。
Specifically, the block definition in the drawing is traversed and the name of the block definition is printed: valve, stop valve, ball valve, manual control ball valve;
then, the block definitions are traversed in turn, for example, the valve block definition is traversed first, and the traversing result is that the valve block definition does not contain other block definitions and is referenced by other block definitions, and then the valve block definition is a root node relative to itself and is a child node of the other three block definitions.
Then traversing the second block definition-stop valve block definition, wherein the traversing result is as follows: the stop valve block definition includes the valve block definition and is not included by other block definitions, at this time, the stop valve is a child node under the valve block definition, and the valve is a root node.
The same method traverses ball valve block definition, and the traversing result is as follows: the ball valve block is defined as a sub-node defined by the valve block, and the root node is a valve.
The same method traverses the definition of the manual control ball valve block, and the traversing result is as follows: the manual control ball valve is a sub-node defined by a ball valve block, and the ball valve block definition also comprises a valve block definition, at the moment, the valve is a root node, a sub-node named as a ball valve is arranged below the root node, and a sub-node named as a manual control ball valve is arranged below the ball valve sub-node.
By generating and displaying the tree diagram of the block definitions, the nesting relation among the block definitions is clear at a glance, and the cleaning of engineers on the block definitions is facilitated.
With reference to the first aspect, the step of defining a tree graph based on blocks, in response to a deletion operation defined by a target node block, includes:
responding to selected operation and deleting operation aiming at the definition of the target node block in the block definition tree diagram, and acquiring the node type corresponding to the definition of the target node block;
and executing corresponding deleting operation according to the node type defined by the target node block.
With reference to the first aspect, the CAD tool further includes a block definition list for storing block definitions; the step of executing the corresponding deletion operation according to the node type defined by the target node block includes:
and if the node type of the target node block definition is a child node, deleting the target node block definition and updating the block definition list.
If the node type of the target node block definition is the root node, judging whether a child node block definition exists under the target node block definition, if so, displaying prompt information that the target node block definition has references and cannot be deleted; if not, deleting the block definition corresponding to the target node block definition and updating the block definition list.
In short, a target node block definition to be cleaned can be cleaned only if the target node block definition is not contained by other block definitions.
When a target node block definition in a tree diagram is selected and deleting operation is executed, firstly acquiring a node type corresponding to the target node block definition, and when the node type of the target node block definition is a child node, indicating that the target node block is not referenced by other block definitions, wherein the block definition can be deleted directly; when the node type of the target node block is a root node, judging whether a sub node block exists under the target node block, namely judging whether other block definitions comprise the target node block definition, if not, indicating that the sub node block does not exist under the target node block definition, and cleaning the target node block definition at the moment so as to thoroughly delete the block definition in a drawing file; if yes, the target node block definition is referenced and nested by other block definitions, the target node block cannot be deleted at the moment, and prompt information that the target node block cannot be deleted is provided.
In combination with the first aspect, the step of defining a tree graph based on the blocks, and responding to the deletion operation defined by the target node block includes:
responding to the touch operation of the second designated key, and displaying a cleanable item list corresponding to the CAD image in the block definition cleaning plug-in;
marking the target block definition as a selected state in response to a selection operation for the target block definition;
and deleting the target block definition in response to the touch operation for the third designated key.
Displaying a clearly-defined item list when an engineer touches a key to clear a target node block definition, wherein the list enumerates deletable block definitions, and deleting the target block definition in the drawing file by the processor after selecting the target block definition and determining to delete the touch operation.
In combination with the first aspect, the CAD tool further comprises a block editor, the method further comprising:
one or more block references are added at the block editing interface in response to a touch operation for the block editor.
For each block reference, responding to attribute triggering operation for the block reference, and displaying a corresponding attribute editing interface of the block reference; the property editing interface is provided with style editing options.
In response to an editing operation or a selection operation for a style editing option, the adjustment block refers to the corresponding attribute.
In response to a save operation for a block reference, the block reference is stored in a block definition list and the block definition is displayed in the block definition list.
The block definitions may be edited by a block editor to facilitate the cartographic process.
In combination with the first aspect, the block definition cleaning assistance triggering operation includes a touch operation on a first designated key or a touch operation on a designated control.
In this embodiment, the quick cleaning auxiliary tool may be started by touching a designated key or touching a designated control, where the designated key may be predefined for a user, for example, the designated key is set to be F5, and touching the F5 key may trigger the block to define the cleaning auxiliary tool; the touch control designating control is also preset and constructed, such as "blockPurge. Exe" software.
Now, for example, in response to an open operation for a "nested block-valve-dwg" target drawing file, a CAD image corresponding to "nested block-valve-dwg" is displayed;
the 'nested block-valve-dwg' drawing file comprises four block definitions of a valve, a stop valve, a ball valve and a manual control ball valve, and the nested relation among the block definitions is shown in figure 2; and touching a first designated key such as F5 to trigger a block definition cleaning auxiliary tool and starting a block definition cleaning plug-in, and generating and displaying a block definition tree diagram corresponding to the nested block-valve dwg drawing, wherein the interface schematic diagram is shown in figure 3.
Based on the block definition tree diagram, four root nodes from top to bottom are all 'valves', and a child node block does not exist under the first root node; the child node block existing under the second root node is a 'stop valve'; the child node block under the third root node is a ball valve; the sub-node blocks existing under the fourth root node are ball valves which are used as block references of manual control ball valves, namely the manual control ball valve sub-nodes exist under the ball valve sub-nodes.
At this time, the deleting operation of the corresponding target node block definition judges the node type defined by the target node block, for example, in this embodiment, the target node block is "valve", and it is judged that the sub-node with which the "valve" is referred to as a block exists, and at this time, a prompt message that the "valve" is referred to by another block and cannot be cleared is displayed. In this case, the "valve" needs to be deleted after deleting the block definitions corresponding to all the child nodes. That is, it is necessary to delete all of the block definitions named "manual control ball valve", "stop valve", and then confirm that no child node exists under the "valve" block definition to delete the "valve" definition.
The specific operation is as follows: judging whether a child node exists under the definition of the target node block based on a block definition tree diagram, if not, deleting the block reference corresponding to the definition of the target node block in the drawing, triggering the touch operation (such as 'Delete') of a second designated key to display a cleanable item list corresponding to the CAD image in the block definition cleaning plug-in, selecting the definition of the target node block, confirming, deleting the definition of the target node block, and thoroughly cleaning the definition of the target node block at the moment.
If the sub node exists under the target node block definition, deleting the block reference corresponding to the sub node block definition under the target node block definition in the drawing, triggering the touch operation (such as 'Delete') of the second designated key to display the cleanable item list corresponding to the CAD image in the block definition cleaning plug-in, selecting the sub node block definition and confirming, deleting the sub node block definition until the sub node does not exist under the target node block definition, and repeating the steps at the moment to Delete the target node block definition.
In a second aspect, the present embodiment provides a block cleaning device for CAD, which is applied to a CAD tool, where the CAD tool is loaded with a drawing file and a block definition cleaning plug-in. Referring to fig. 4, the apparatus includes: the image display module 10, the target block reference deletion module 20, the tree diagram generation display module 30, and the deletion module 40.
The image display module 10 is configured to display a CAD image corresponding to a target drawing document in response to an opening operation for the target drawing document.
The target block reference deleting module 20 is used for deleting target block references in CAD images in response to deleting operations for target references
The tree diagram generation and display module 30 is configured to generate and display a block definition tree diagram corresponding to the CAD image in response to an on operation for the block definition cleaning plug-in and a block definition cleaning auxiliary trigger operation; the block definition tree graph comprises a root node block and a child node block below the root node block.
The deletion module 40 is configured to respond to a deletion operation of the target node block based on the block definition tree graph.
In this embodiment, a CAD image corresponding to a target drawing file is displayed by an image display module, a block definition tree diagram corresponding to the CAD image is generated and displayed by a tree diagram generation display module, the block definition tree diagram includes a root node block and a child node block under the root node block, then a deletion operation in response to the target node block is performed based on the block definition tree diagram, and a prompt message indicating that the target node block cannot be deleted is displayed when the target node block is defined as a root node and a reference exists in the target node block definition.
In a third aspect, the present embodiment provides an electronic device, which in combination with fig. 5 includes a processor and a memory, where the memory stores a computer program, and the processor is configured to execute the computer program to implement the method described above.
In a fourth aspect, the present embodiment provides a storage medium having a computer program stored therein, and a processor executing the computer program to implement the above method.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
In addition, in the description of embodiments of the present application, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present application will be understood by those skilled in the art in specific cases.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present application, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present application for illustrating the technical solution of the present application, but not for limiting the scope of the present application, and although the present application has been described in detail with reference to the foregoing examples, it will be understood by those skilled in the art that the present application is not limited thereto: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (7)

1. The block cleaning method of the CAD is characterized in that the method is applied to a CAD tool, and the CAD tool is loaded with a drawing file and a block definition cleaning plug-in; the method comprises the following steps:
responding to an opening operation for a target drawing file, and displaying a CAD image corresponding to the target drawing file; loading a block reference in the CAD image;
deleting the target block reference in the CAD image in response to a deletion operation for the target block reference;
responding to the opening operation of the block definition cleaning plugin and the block definition cleaning auxiliary triggering operation, traversing the block definition in the target drawing file by referring to the corresponding block definition, judging whether other block definitions are contained in the block definition or not according to each block definition, if so, traversing the sub-node marking the block definition as the other block definition, and if not, marking the block definition as a root node to generate and display a block definition tree diagram corresponding to the CAD image; the block definition tree diagram comprises a root node block definition and a child node block definition under the root node block;
responding to selected operation and deleting operation aiming at a target node block definition in a block definition tree diagram, and acquiring a node type corresponding to the target node block definition;
if the node type of the target node block definition is a child node, deleting the target node block definition and updating the block definition list;
if the node type of the target node block definition is a root node, judging whether a child node block definition exists under the target node block definition, if so, displaying prompt information that the target node block definition has a reference and cannot be deleted; and if not, deleting the block definition corresponding to the target node block definition and updating the block definition list.
2. The method of claim 1, wherein the step of responding to a delete operation defined by a target node block based on the block definition tree comprises:
responding to the touch operation of a second designated key, and displaying a cleanable item list corresponding to the CAD image in the block definition cleaning plug-in;
marking a target block definition as a selected state in response to a selection operation for the target block definition;
and deleting the target block definition in response to the touch operation aiming at the third designated key.
3. The method of claim 1, wherein the CAD tool further comprises a block editor, the method further comprising:
adding one or more block references at a block editing interface in response to a touch operation for the block editor;
for each block reference, responding to attribute triggering operation for the block reference, and displaying an attribute editing interface corresponding to the block reference; a style editing option is arranged in the attribute editing interface;
responding to the editing operation or the selecting operation aiming at the style editing options, and adjusting the corresponding attribute of the block reference;
and storing the block references in the block definition list in response to a save operation for the block references, and displaying the block definitions in the block definition list.
4. The method of claim 1, wherein the block definition cleanup assistance trigger operation comprises a touch operation on a first designated key or a touch operation on a designated control.
5. The block cleaning device for the CAD is characterized in that the device is applied to a CAD tool, and the CAD tool is loaded with a drawing file and a block definition cleaning plug-in; the CAD tool further comprises a list of block definitions for storing the block definitions; the device comprises:
the image display module is used for responding to the opening operation of the target drawing file and displaying the CAD image corresponding to the target drawing file; loading a block reference in the CAD image;
a target block reference deleting module, configured to delete a target block reference in the CAD image in response to a deleting operation for the target reference;
the tree diagram generation display module is used for responding to the starting operation of the block definition cleaning plugin and the block definition cleaning auxiliary triggering operation, traversing the block definition in the target drawing file, referring to the corresponding block definition, judging whether other block definitions are contained in the block definition or not according to each block definition, if so, traversing the sub-node marking the block definition as the other block definition, and if not, marking the block definition as a root node so as to generate and display a block definition tree diagram corresponding to the CAD image; the block definition tree graph comprises a root node block and a child node block under the root node block;
the node type acquisition module is used for responding to the selected operation and the deleting operation aiming at the target node block definition in the block definition tree diagram and acquiring the node type corresponding to the target node block definition;
a first deleting module, configured to delete the target node block definition and update the block definition list when the node type of the target node block definition is a child node;
the second deleting module is used for judging whether a child node block definition exists under the target node block definition or not under the condition that the node type of the target node block definition is a root node, and if so, displaying prompt information that the target node block definition has a reference and cannot be deleted; and if not, deleting the block definition corresponding to the target node block definition and updating the block definition list.
6. An electronic device comprising a processor and a memory, the memory having stored therein a computer program for executing the computer program to implement the method of any of claims 1-4.
7. A storage medium having a computer program stored therein, the computer program being executable by a processor to implement the method of any one of claims 1-4.
CN202310869713.0A 2023-07-17 2023-07-17 CAD block cleaning method and device, electronic equipment and storage medium Active CN116595602B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310869713.0A CN116595602B (en) 2023-07-17 2023-07-17 CAD block cleaning method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310869713.0A CN116595602B (en) 2023-07-17 2023-07-17 CAD block cleaning method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116595602A CN116595602A (en) 2023-08-15
CN116595602B true CN116595602B (en) 2023-09-22

Family

ID=87604790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310869713.0A Active CN116595602B (en) 2023-07-17 2023-07-17 CAD block cleaning method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116595602B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2758363A1 (en) * 2011-11-14 2013-05-14 Ian M. Baranesky Machine and method for modifying, extracting and displaying cad drawing block attributes in an intuitive workflow
CN114399784A (en) * 2022-01-20 2022-04-26 广东博智林机器人有限公司 Automatic identification method and device based on CAD drawing
CN114595494A (en) * 2022-03-14 2022-06-07 黑龙江八一农垦大学 Auxiliary design tool kit based on AutoCAD software and construction method
CN115171145A (en) * 2022-06-10 2022-10-11 中核核电运行管理有限公司 Drawing primitive processing method and device
CN115391290A (en) * 2022-08-23 2022-11-25 一汽解放汽车有限公司 Object file cleaning method, device, computer equipment, medium and program product

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8554520B2 (en) * 2007-05-01 2013-10-08 Auto Prep, Llc Systems and methods for differentiating and associating multiple drawings in a CAD environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2758363A1 (en) * 2011-11-14 2013-05-14 Ian M. Baranesky Machine and method for modifying, extracting and displaying cad drawing block attributes in an intuitive workflow
CN114399784A (en) * 2022-01-20 2022-04-26 广东博智林机器人有限公司 Automatic identification method and device based on CAD drawing
CN114595494A (en) * 2022-03-14 2022-06-07 黑龙江八一农垦大学 Auxiliary design tool kit based on AutoCAD software and construction method
CN115171145A (en) * 2022-06-10 2022-10-11 中核核电运行管理有限公司 Drawing primitive processing method and device
CN115391290A (en) * 2022-08-23 2022-11-25 一汽解放汽车有限公司 Object file cleaning method, device, computer equipment, medium and program product

Also Published As

Publication number Publication date
CN116595602A (en) 2023-08-15

Similar Documents

Publication Publication Date Title
US11893312B2 (en) Multi-directional editing within a multi-user cloud parametric feature-based 3D CAD system
US7436407B2 (en) Topology determination, decomposable shape generation, and structured mesh generation
Lipp et al. Interactive visual editing of grammars for procedural architecture
US8040358B2 (en) Graphical object generation and regeneration
JP3657771B2 (en) 3D model creation device
JPH05205012A (en) Method of changing cad data
JPWO2008132977A1 (en) Image editing apparatus and image editing system
US7523396B2 (en) Surface construction audit trail and manipulation
JP2008217651A (en) Design support device, design support method and program
JP2007017945A (en) Information processing apparatus and method
CN116595602B (en) CAD block cleaning method and device, electronic equipment and storage medium
JP2011113529A (en) Geometry simplification apparatus, geometry simplification method, and program
JP2006209179A (en) Model difference detection tool
JP2003303213A (en) Design work supporting apparatus
JP3898485B2 (en) Drawing drawing display device, drawing drawing display method, and recording medium
JPH07168873A (en) Cad system capable of setting editing inhibition area
JP5084702B2 (en) Analysis data input device, CAE device, analysis data input method, and program
JP7380376B2 (en) Program for displaying information processing equipment and ladder programs
JP2020201654A (en) Operation manual creation support device and operation manual creation support method
JP4347017B2 (en) Information processing method and image processing method
JP2004310317A (en) Business support device
JP4617212B2 (en) Design support device
KR102026663B1 (en) Method for modeling a ship inner panel and record media recorded program realizing the same
JP2009157751A (en) Apparatus for supporting software development
JP2008059164A (en) Flow diagram editing apparatus, method and program

Legal Events

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