Modeling and drawing method of stamping die, control system, storage medium and equipment

Through a stamping mold modeling method, multi-subprocess parallel processing is used to solve the problems of efficiency bottlenecks, stability challenges, accuracy and technical barriers in complex mold design, and the rapid batch production of engineering drawings is achieved, improving the drawing efficiency and design accuracy.

CN119538512AActive Publication Date: 2025-02-28DONGGUAN QITAI INTELLIGENT TECHNOLOGY CO LTD JIANGXI BRANCH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411445549.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-02-28
Estimated Expiration
2044-10-16

AI Technical Summary

Technical Problem

When faced with complex mold design, existing drawing technology has efficiency bottlenecks, stability challenges, lack of accuracy and technical and experience barriers, which are difficult to meet the needs of rapid design verification and iteration.

Method used

Provide a modeling and drawing method for stamping molds, including configuring processing standards, starting interface programs, task allocation, and executing tasks. Through parallel processing and monitoring of multiple subprocesses, it realizes batch rapid production of engineering drawings.

Benefits of technology

It improves the efficiency of drawing, reduces labor and time costs, enhances the continuity of design work and project progress, and improves the accuracy and consistency of design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538512A_ABST
    Figure CN119538512A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent die design and manufacturing, in particular to a modeling and drawing method of a stamping die, a control system, a storage medium and equipment. Starting an interface program, selecting a drawing format, filling public information, and serializing the public information and customer configuration information on an interface to form a ui. Bin file; task allocation: marking all the selected parts through attributes according to information in the ui. Bin file, and independently linking all the parts to a temporary part temp.part according to a layer to be used by a sub-process; creating a plurality of sub-processes, and distributing the tasks to the sub-processes; meanwhile, maintaining a sub-process list, clearing an ending process and adding a new process; and executing a task, performing feature analysis, annotation matching, view projection and typesetting on the part, and finally exporting a DWG file. According to the method, engineering drawings can be rapidly made in batches, drawing efficiency is improved, and labor cost and time cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent mold design and manufacturing, and in particular to a modeling and drawing method, a control system, a storage medium and equipment for a stamping mold. Background Art

[0002] In the context of the rapid development of modern engineering technology and manufacturing industry, the efficiency of product design and mold development directly affects the market competitiveness of enterprises. However, the commonly used mapping technologies in the current market mainly include single-process-based software operations, closed internal mapping modes, and methods that are highly dependent on manual drawing. These traditional technical solutions are facing the increasing complexity and precision requirements. Their limitations are becoming more and more prominent. In the process of implementing the technical solutions of the invention in the embodiments of the present application, the inventors of the present application found that the above-mentioned technology has at least the following technical problems:

[0003] 1. Efficiency bottleneck: Due to the limitation of computing resource allocation, single-process drawing software is slow to respond when processing large-scale or highly complex mold designs, making it difficult to meet the needs of rapid design verification and iteration, thus slowing down the time to market.

[0004] 2. Stability Challenge: The drawing process that relies on manual operation is easily affected by subjective factors. In addition, the stability problem of the single-process system under high load, frequent software crashes and data recovery needs seriously affect the continuity of design work and project progress;

[0005] 3. Lack of accuracy: Although manual drawing can reflect the designer's creative flexibility, human errors are difficult to avoid in the pursuit of micron-level precision mold design, and cumulative errors are prone to occur during multiple modifications, reducing the quality and consistency of the final product;

[0006] 4. Technical and experience barriers: Traditional drafting methods are highly dependent on the professional skills and rich experience of designers. For complex mold design, new or less experienced designers often need a longer learning curve, which limits the team's overall productivity and innovation capabilities. The design of large and complex molds is often accompanied by countless adjustments and optimizations. This process is not only time-consuming, but also requires a lot of manpower and material resources, which significantly increases the company's operating costs. Summary of the invention

[0007] The present invention solves the technical problems of limitations of existing drawing technologies in the prior art by providing a modeling and drawing method, control system, storage medium and equipment for a stamping die. The present invention has wide applicability, realizes rapid batch production of engineering drawings, improves drawing efficiency, and reduces labor costs and time costs.

[0008] The present invention provides a modeling and drawing method for a stamping die, which comprises the following steps:

[0009] Step S1, configuring processing standards;

[0010] Step S2, start the interface program, select the output format and fill in the public information, and serialize the public information and customer configuration information on the interface to form a ui.bin file;

[0011] Step S3, task assignment, marking all selected parts by attributes according to the information in the ui.bin file, and linking all parts individually by layer to a temporary part temp.part for use by the sub-process; creating multiple sub-processes, and assigning tasks to the sub-processes; maintaining the sub-process list, monitoring the sub-process status, clearing the end process and adding a new process;

[0012] Step S4, execute the task, analyze the features of the parts, match the annotations, project the views and layout them, and finally export the DWG file.

[0013] The configuration processing standard in step S1 includes customer configuration information, and the customer configuration information includes processing color, annotation format, screw model, part attribute name and annotation tolerance.

[0014] Wherein, the step S2 includes the following steps:

[0015] Step S21, selecting the format of the drawing and filling in relevant information in the human-computer interaction interface;

[0016] Step S22, select the drawing part, and provide two selectors, including a conventional view part selector and a lightweight view part selector;

[0017] Step S23, serializing the interface information, serializing the status information of the buttons on the interface, the input information of the text box, and the handle information of all the part entities in the selector in a binary format into a .bin file on the local disk;

[0018] Step S24, passing the path information of the current image file as a parameter of the function to the called program.

[0019] Wherein, the step S3 includes the following steps:

[0020] Step S31, loading the image file. After the program is started, the image file path passed by the interface program is first obtained from the parameter list of the entry function mian, and the image file data is loaded through the function provided by NXOpen Api;

[0021] Step S32, obtaining serialization information, and reading the handle information of all selected parts from the generated .bin file on the specified path;

[0022] Step S33, marking the part entity, obtaining all selected parts from the loaded drawing file according to the handle information through the function provided by NXOpen Api, and marking the part entity with the attribute name selected;

[0023] Step S34, using the function provided by NXOpen Api, obtain the layer attributes of each part entity, group the parts with the same layer into one group, and store all the groups in the list groupList;

[0024] Step S35, traverse the list and call the working program to process each group of parts: take out each group in turn, create a temporary drawing file through NXOpen Api to link all the part entities in the group to the zero-time drawing file, and save the zero-time drawing file to the specified path of the local disk; create a process to start the working program drawer.exe through the function provided by Windows api, and store the process handle in a data table processMap of a map structure type;

[0025] Step S36, task check. When the task is assigned and all subprocesses exit the active state, check whether there is a DWG drawing file named corresponding to each layer of parts in the specified file directory through the method provided by the C++ standard library. If the file does not exist, it means that the task has failed. Then start the working process again, reallocate the failed task for execution, and then check whether the drawing file corresponding to the task is generated after completion. If the task fails for the second time, all the output parts of the task layer are executed separately to filter out the failed parts, and the number and layer information of the failed parts are recorded in a local txt file in the form of a log. After the program ends, open the file and display it to the user for reading.

[0026] Wherein, the step S4 includes the following steps:

[0027] Step S41, loading the task file. When the working program drawer.exe is started, the task file path **.prt passed is obtained through the parameter list of the program entry function main and the file is opened through the unfun api to load the part data into the memory;

[0028] Step S42, read the configuration table, load the basic attribute configuration table, tolerance configuration table, feature annotation table and design standard table;

[0029] Step S43, read part attribute information, and obtain all attribute names specified by the user;

[0030] Step S44, feature analysis, including plane slot analysis, through slot analysis, countersunk hole analysis and tooth hole analysis; Step S45, processing annotation matching, reading all the information in the feature annotation configuration table, matching corresponding processing annotation entries to all the features stored in the SlotPlannarStructList, TongCaoStructList, ScrewWhitHeadStructList, ScrewStructList and other lists according to the type, structure, color, layer, diameter and other data of the features, and filling in the parameters of the diameter and depth of each feature into the entry;

[0031] Step S46, drawing;

[0032] Step S47, exporting the dwg file. After all parts of the current layer are drawn, the current drawing page is exported to the specified path to save the dwg file through the interface NXOpen::DxfdwgCreator provided by NXOpen.

[0033] The mapping in step S46 includes the following steps:

[0034] Step S461, create a drawing, reserve a view area of ​​10000 in width and height for each part, and then according to the number of parts in the current layer viewCount, obtain the width of the drawing sheetW = viewW*viewCount, and the height sheetW = viewH; then create the drawing through the function UF_DRAW_create_drawing;

[0035] Step S462: Create a temporary view according to the view matrix, and traverse each output part in turn:

[0036] Step S463, calculate the view layout, calculate the projection coordinates of each view of the part and the length and width of the area occupied by all views according to the length, width and height information of the part, and then calculate the actual frame size according to the ratio of the frame; then scale the size of the frame standard font according to the ratio of the standard frame size and the actual frame size, and obtain the annotation font size fontSize of the current part view;

[0037] Step S464, projection view, first hide all parts and only display the current drawing part; then use the function UF_DRAW_import_view to project the temporary view of the part created previously into a 2D view as the main view mainView of the part; then use the function UF_DRAW_add_orthographic_view to project the side view of the part based on the main view mainView;

[0038] Step S465, primitive annotation, integrating the processing annotations of all features in the lists such as SlotPlannarStructList, TongCaoStructList, ScrewWhitHeadStructList, ScrewStructList, etc., classifying and counting the features with the same annotation terms, and sorting the features with the same primitive letters but different terms, and splicing the serial numbers after the letters as the annotated primitives;

[0039] Step S466, create a processing annotation. When the overall height of the annotation + the overall height of the view < the overall length of the view × 0.75, the annotation is placed at the lower left corner of the view area; when the overall height of the annotation < the height of the front view, the annotation is placed on the right side of the front view; when the overall height of the annotation < the overall height of the view, the annotation is placed on the right side of the view area; when the overall height of the annotation > the overall height of the view, and the overall height of the view < the overall length of the view, the annotation is divided into multiple blocks and placed below the view area; when the overall height of the annotation > the overall height of the view, and the overall height of the view > the overall length of the view, the annotation is divided into multiple blocks and placed on the right side of the view area;

[0040] Step S467, set the view style and extract the view curve.

[0041] The present invention also provides a control system for stamping die modeling and mapping, which is used in the stamping die modeling and mapping method, and comprises:

[0042] Configuration information unit, used to configure processing standards;

[0043] The human-computer interaction interface unit is used to select the output format and fill in the public information, and to serialize the public information and customer configuration information on the interface into a ui.bin file;

[0044] The task allocation unit is used to mark all selected parts by attributes according to the information in the ui.bin file, and link all parts to a temporary part temp.part by layer for use by the sub-process; create multiple sub-processes and assign tasks to the sub-processes; maintain the sub-process list at the same time, monitor the status of the sub-process, clear the end process and add a new process;

[0045] Execute task units to perform feature analysis, annotation matching, view projection and layout of parts, and finally export DWG files.

[0046] The present invention also provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the modeling and drawing method of the stamping die.

[0047] The present invention also provides an electronic device, wherein the electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, enable the processor to execute the modeling and drawing method of the stamping die.

[0048] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:

[0049] By adopting the modeling and drawing method, control system, storage medium and equipment of the stamping die, the technical problems of the limitations of the existing drawing technology in the prior art are solved, the invention has wide applicability, realizes the rapid batch production of engineering drawings, improves the drawing efficiency, and reduces the labor cost and time cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flow chart of a modeling and drawing method for a stamping die according to Embodiment 1 of the present application. DETAILED DESCRIPTION

[0051] The modeling and drawing method, control system, storage medium and equipment of the stamping die in the embodiments of the present application solve the technical problems of the limitations of the existing drawing technology in the prior art, have wide applicability, realize the rapid batch production of engineering drawings, improve drawing efficiency, and reduce labor costs and time costs.

[0052] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0053] Embodiment 1

[0054] Embodiment 1 of the present application provides a modeling and drawing method for a stamping die, which comprises the following steps: step S1, configuring a processing standard;

[0055] Step S2, start the interface program, select the output format and fill in the public information, and serialize the public information and customer configuration information on the interface to form a ui.bin file;

[0056] Step S3, task assignment, marking all selected parts by attributes according to the information in the ui.bin file, and linking all parts individually by layer to a temporary part temp.part for use by the sub-process; creating multiple sub-processes, and assigning tasks to the sub-processes; maintaining the sub-process list, monitoring the sub-process status, clearing the end process and adding a new process;

[0057] Step S4, execute the task, analyze the features of the parts, match the annotations, project the views and layout them, and finally export the DWG file.

[0058] The configuration processing standard in step S1 includes customer configuration information, and the customer configuration information includes processing color, annotation format, screw model, part attribute name and annotation tolerance.

[0059] Wherein, the step S2 includes the following steps:

[0060] Step S21, select the format of the drawing and fill in the relevant public information in the interface program;

[0061] Step S22, select the drawing part, and provide two selectors, including a conventional view part selector and a lightweight view part selector;

[0062] The drawing generated by the part selected by the conventional view part selector is a standard drawing with complete annotation information; the lightweight view selector is an alternative design for some highly complex parts such as casting molds and parts with more surfaces, because such parts are prone to modeling crashes and freezes in low-version design software such as NX8.5 when drawn in the conventional way, while the lightweight view will ignore and simplify some view details, so that the drawing can be generated smoothly;

[0063] Step S23, serializing the interface information, serializing the status information of the buttons on the interface program, the input information of the text box, and the handle information of all the part entities in the selector in a binary format into a .bin file on the local disk;

[0064] Step S24, calling the intermediate program Allocator.exe responsible for task allocation and work process scheduling through the function shellexe provided by the window api, and passing the path information of the current image file to the called program as a parameter of the function.

[0065] In the first embodiment of the present application, the step S3 includes the following steps:

[0066] Step S31, loading the image file. After the program is started, the image file path passed by the interface program is first obtained from the parameter list of the entry function mian, and the image file data is loaded through the function provided by NXOpen Api;

[0067] Step S32, obtaining serialization information, and reading the handle information of all selected parts from the generated .bin file on the specified path;

[0068] Step S33, marking the part entity, obtaining all selected parts from the loaded drawing file according to the handle information through the function provided by NXOpen Api, and marking the part entity with the attribute name selected;

[0069] Step S34, using the function provided by NXOpen Api, obtain the layer attributes of each part entity, group the parts with the same layer into one group, and store all the groups in the list groupList;

[0070] Step S35, traverse the list and call the work program to process each group of parts: take out each group in turn, create a temporary drawing file through NXOpen Api to link all the part entities in the group to the zero-time drawing file, and save the zero-time drawing file to the specified path of the local disk; create a process through the function provided by Windows api to start the work program drawer.exe, and store the process handle in a data table processMap of a map structure type (the key value is the timestamp of process creation and val is the process handle value) for subsequent monitoring and maintenance; here, for performance considerations, the survival status of the process in the processMap table will be checked before each new work process is created. If the existing active process is less than 4, a new work process will be created, otherwise the allocated process will sleep for 3 seconds before the next process check. (During the inspection, the process in the list will be timed out according to the creation timestamp of the process. If the child process survives for more than a reasonable time, the process will be forced to end);

[0071] Step S36, task check. When the task is assigned and all subprocesses exit the active state, check whether there is a DWG drawing file named corresponding to each layer of parts in the specified file directory through the method provided by the C++ standard library. If the file does not exist, it means that the task has failed. Then start the working process again, reallocate the failed task for execution, and then check whether the drawing file corresponding to the task is generated after completion. If the task fails for the second time, all the output parts of the task layer are executed separately to filter out the failed parts, and the number and layer information of the failed parts are recorded in a local txt file in the form of a log. After the program ends, open the file and display it to the user for reading.

[0072] In the first embodiment of the present application, the step S4 includes the following steps:

[0073] Step S41, loading the task file. When the working program drawer.exe is started, the task file path **.prt passed is obtained through the parameter list of the program entry function main and the file is opened through the unfun api to load the part data into the memory;

[0074] Step S42, read the configuration table, load the basic attribute configuration table, tolerance configuration table, feature annotation table and design standard table;

[0075] Step S43, read part attribute information, obtain all attribute names specified by the user; then read some attributes assigned to the part entity in advance through some function interfaces provided by NXOpen API, which mainly include: part number, part name, part specification, view matrix, view zero point coordinates, material, weight, page number and other basic information;

[0076] Step S44, feature analysis, including plane slot analysis, through slot analysis, countersunk hole analysis and tooth hole analysis;

[0077] Among them, through NXOpen API:

[0078] Plane slot analysis:

[0079] According to the normal and coordinates of the plane, filter out all the concave planes planeFace1 on the part entity whose normals are parallel to the view direction and whose coordinates are 0.5mm lower than the upper surface of the part and 0.5mm higher than the lower surface of the part;

[0080] Get all adjacent faces of plane planeFace1, filter out all sides whose plane normal is perpendicular to the view direction, whose cylindrical axis is parallel to the view direction, and whose maximum coordinate is in the positive direction of plane planeFace1, and store them in the list slideFaceList;

[0081] By comparing the normal direction of planeFace1 and the view direction, fontOrBack of the plane slot is determined. The depth depth from planeFace1 to the surface of the part entity is obtained. The color bottomFaceColor and the color slideFaceColor of the side of planeFace1 are obtained. The center point centerPt of planeFace1 is obtained as the annotation point.

[0082] Store all the above data into a data structure SlotPlannarStruct, and then store SlotPlannarStruct into the list SlotPlannarStructList.

[0083] Through slot analysis:

[0084] According to the normal of the plane, filter out all planes planeFace1 on the part entity whose normal is parallel to the view direction, and then use the function UF_MODL_ask_face_loops to obtain all loops loopList on the plane planeFace1, and filter out the planes with less than 2 loops;

[0085] Traverse the list loopList, get the number of each ring edge, if the number is greater than 1, get the face according to all the edges on the ring, exclude the plane planeFace1, and take all the faces whose plane normal is perpendicular to the view direction and the cylindrical axis is parallel to the view direction as the side of the slot slideFaceList;

[0086] Traverse the list slideFaceList, take the offset point ptMidOffset of the midpoint of the horizontal edge on the side slideFace1 in turn, which is offset by 0.1mm in the direction (plane normal, cylindrical arc edge end point to arc center), and use the function UF_MODL_trace_a_ray to perform ray detection in both the positive and negative directions of the view direction to determine whether the groove is a through groove. If so, get the color slideFace1 of the side slideFaceColor, and get the center point centerPt of the groove as the marking point;

[0087] Store all the above data in a data structure TongCaoStruct, and then store TongCaoStruct in the list TongCaoStructList.

[0088] Countersunk hole analysis:

[0089] According to the normal of the plane, filter out all the planes headFaceList on the part entity whose normal is parallel to the view direction, and then filter out the planes in the list whose longest edge is not an arc according to the edges on the face; filter out the outer surfaces of all entities in the list according to the coordinates; then use the function UF_MODL_ask_face_loops to obtain all the loops loopList on each plane in the list, and exclude the planes with less than 2 loops;

[0090] Traverse the list headFaceList, get all the adjacent faces adjFacesList of each face headFace1 in turn, and then select two concentric cylinders cylinder1 and cylinder2 from them, and determine whether cylinder1 and cylinder2 are on the front and back sides of headFace1 through the coordinates of the three faces headFace1, cylinder1, and cylinder2. If so, get their adjacent faces through cylinder1 and cylinder2 respectively, and determine whether there is a third-level cylinder cylinder3 through concentricity;

[0091] (The countersunk holes are defined up to level three here) Arrange cylinder1, cylinder2, and cylinder3 from small to large according to the aperture size, and obtain the countersunk planes headFace1 and headFace2 between them, and obtain the cylinder surface colors cylinder1Color, cylinder1Color, and cylinder1Color. Obtain the countersunk surface colors headFace1ColorheadFace2Color, and determine the direction (front / back) of the countersunk hole FontOrBack by comparing the normal of the countersunk surface with the view direction; obtain the diameters of the cylinder surface cylinder1diam, cylinder2diam, and cylinder3diam, obtain the depths of the countersunk plane depth1 and depth2, and obtain the center of the largest cylinder surface cylinder3diam centerPt as the marking point;

[0092] Store all the above data into a data structure ScrewWhitHeadStruct, and then store ScrewWhitHeadStruct into the list ScrewWhitHeadStructList.

[0093] Tooth hole analysis:

[0094] According to the axial direction of the cylinder, obtain cylinderList of all cylinders whose axial directions are parallel to the view direction, and then exclude all non-closed cylinders in cylinderList according to whether the horizontal and vertical dimensions of each cylinder are equal to the diameter of the cylinder;

[0095] Traverse each cylinder cylinder1 in cylinderList in turn, get the adjacent faces of cylinder cylinder1 through the function UF_MODL_ask_adjac_faces, and search for a plane or conical surface whose normal is parallel to the cylinder and whose horizontal and vertical dimensions are equal to the cylinder diameter as the bottom face bottomFace from all adjacent faces. If there is no plane or conical surface, the cylinder is a through hole holeType=1, and if there is a blind hole holeType=0; get the diameter diam, depth depth, color cylinder1Color of cylinder cylinder1, get the center centerPt of cylinder cylinder1 as the marking point, get the color bottomFaceColor of the bottom face of the blind hole, store all the above data in a data structure ScrewStruct, and then store ScrewStruct in the list ScrewStructList.

[0096] Step S45, processing annotation matching, read all the information in the feature annotation configuration table, match the corresponding processing annotation entries to all the features stored in the SlotPlannarStructList, TongCaoStructList, ScrewWhitHeadStructList, ScrewStructList and other lists according to the type, structure, color, layer, diameter and other data of the feature, and fill in the parameters of the diameter and depth of each feature into the entry;

[0097] Step S46, drawing;

[0098] Step S47, exporting the dwg file. After all parts of the current layer are drawn, the current drawing page is exported to the specified path to save the dwg file through the interface NXOpen::DxfdwgCreator provided by NXOpen.

[0099] The mapping in step S46 includes the following steps:

[0100] Step S461, create a drawing, reserve a view area of ​​10000 in width and height for each part (viewW=10000, viewH=10000), and then according to the number of parts in the current layer (viewCount), obtain the width of the drawing sheetW=viewW*viewCount, and the height sheetW=viewH; then create the drawing through the function UF_DRAW_create_drawing;

[0101] Step S462, create a temporary view according to the view matrix, and traverse each part to be drawn in turn: Since the placement of each part in the drawing is not fixed, we must project the part onto the drawing plane according to the specified orientation when drawing; and to do this, we must first create a temporary working view tempView according to the view matrix of the part (similar to choosing an angle to take a photo). This temporary view is the key object for projecting 2D engineering drawings; here we use the two functions uc6434 and uc6450 provided by NX officially. Function interface uc6434 is responsible for creation, and function interface uc6450 is responsible for saving.

[0102] Step S463, calculating the view layout, firstly calculating the projection coordinates of each view of the part and the length and width of the area occupied by all views according to the length, width and height information of the part, and then calculating the size of the actual frame according to the ratio of the frame; then scaling the size of the standard frame font according to the ratio of the standard frame size and the actual frame size, and obtaining the annotation font size fontSize of the current part view;

[0103] Step S464, projection view, first hide all parts and only display the current drawing part; then use the function UF_DRAW_import_view to project the temporary view of the part created previously into a 2D view as the main view mainView of the part; then use the function UF_DRAW_add_orthographic_view to project the side view (front, back, left, and right) of the part based on the main view mainView;

[0104] Step S465, primitive annotation, integrating the processing annotations of all features in the lists such as SlotPlannarStructList, TongCaoStructList, ScrewWhitHeadStructList, ScrewStructList, etc., classifying and counting the features with the same annotation terms, and sorting the features with the same primitive letters but different terms, and splicing the serial numbers after the letters as the annotated primitives;

[0105] Entity annotation interference avoidance:

[0106] Considering the problem that when the view annotation primitives are too dense, they will interfere with each other, the following solution is made: map the annotation point centerPt of all features to the main view mainView through the function UF_VIEW_map_model_to_drawing to obtain the 2D point p1;

[0107] According to the font type of the graphic element, measure the approximate conversion coefficient of its font size and character width and height, for example (font type: Fangsong, alignment: bottom left, character spacing 0.5, character aspect ratio 0.7, measurement result: font size conversion coefficient: width 0.5, height 1.0 Note: the more accurate the conversion coefficient, the better);

[0108] Sort all the 2D points of the primitive annotations from top to bottom in the y direction;

[0109] After sorting, check each annotation point p1 and all the annotation points p2 within the range of two times the character height below it in sequence, and compare the distances in the two dimensions of x and y with the character widths and heights of the primitives p1 and p2 to determine whether the primitives p1 and p2 interfere with each other. If so, move the position of the annotation point of the primitive p2 downward (by offsetting the vertical height of the annotation point p1 downward by one character height);

[0110] Finally, all element annotations are created on the main view mainView through NXOpen::CreateDraftingNoteBuilder.

[0111] Step S466, create processing annotations. The arrangement of processing annotations should take into account the overall layout of the view and the fullness of the drawing. When the overall height of the annotation + the overall height of the view < the overall length of the view × 0.75, the annotation is placed in the lower left corner of the view area; when the overall height of the annotation < the height of the front view, the annotation is placed on the right side of the front view; when the overall height of the annotation < the overall height of the view, the annotation is placed on the right side of the view area; when the overall height of the annotation > the overall height of the view, and the overall height of the view < the overall length of the view, divide the annotation into multiple blocks and place them below the view area; when the overall height of the annotation > the overall height of the view, and the overall height of the view > the overall length of the view, divide the annotation into multiple blocks and place them on the right side of the view area; (the length of the annotation is equal to the number of annotation characters × font size × font length coefficient, and the height is equal to the number of annotation lines × font size × font height coefficient);

[0112] Step S467, set the view style and extract the view curve; since multiple parts of the same layer are projected on the same drawing page, in order to prevent the views of different parts from overlapping and interfering with each other, all parts except the current zero must be hidden before projecting the view each time; and before the current part is finished drawing and the next part is drawn, the current part must also be hidden. At this time, due to the association between the view and the part, the view will disappear; therefore, when setting the view style, the edge of the part associated with the view must be extracted as a curve to make the view and the part lose their association, so that the view will not change with the state of the part.

[0113] The interface provided by NXOpen can be used to achieve:

[0114] drawView1->Style()->General()->SetExtractedEdges(Preferences::GeneralExtr actedEdgesOptionNonAssociative).

[0115] Embodiment 2

[0116] Embodiment 2 of the present application provides a control system for modeling and drawing of a stamping die, which is used in a modeling and drawing method of the stamping die, and includes:

[0117] Configuration information unit, used to configure processing standards;

[0118] The human-computer interaction interface unit is used to select the output format and fill in the public information, and to serialize the public information and customer configuration information on the interface into a ui.bin file;

[0119] The task allocation unit is used to mark all selected parts by attributes according to the information in the ui.bin file, and link all parts to a temporary part temp.part by layer for use by the sub-process; create multiple sub-processes and assign tasks to the sub-processes; maintain the sub-process list at the same time, monitor the status of the sub-process, clear the end process and add a new process;

[0120] Execute task units to perform feature analysis, annotation matching, view projection and layout of parts, and finally export DWG files.

[0121] Embodiment 3

[0122] Embodiment 3 of the present application provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the modeling and drawing method of the stamping die.

[0123] Embodiment 4

[0124] Embodiment 4 of the present application provides an electronic device, wherein the electronic device includes: a processor; and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to execute the modeling and drawing method of the stamping die.

[0125] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0129] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0130] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A modeling and drawing method for a stamping die, characterized in that: The following steps are involved: Step S1, configuring processing standards; Step S2, start the interface program, select the output format and fill in the public information, and serialize the public information and customer configuration information on the interface to form a ui.bin file; Step S3, task assignment, marking all selected parts by attributes according to the information in the ui.bin file, and linking all parts individually by layer to a temporary part temp.part for use by the sub-process; creating multiple sub-processes, and assigning tasks to the sub-processes; maintaining the sub-process list, monitoring the sub-process status, clearing the end process and adding a new process; Step S4, execute the task, analyze the features of the parts, match the annotations, project the views and layout them, and finally export the DWG file.

2. The modeling and drawing method of a stamping die according to claim 1, characterized in that: The configuration processing standard in step S1 includes customer configuration information, and the customer configuration information includes processing color, annotation format, screw model, part attribute name and annotation tolerance.

3. The modeling and drawing method of a stamping die according to claim 1, characterized in that: The step S2 includes the following steps: Step S21, selecting the format of the drawing and filling in relevant information in the human-computer interaction interface; Step S22, select the drawing part, and provide two selectors, including a conventional view part selector and a lightweight view part selector; Step S23, serializing the interface information, serializing the status information of the buttons on the interface, the input information of the text box, and the handle information of all the part entities in the selector in a binary format into a .bin file on the local disk; Step S24, passing the path information of the current image file as a parameter of the function to the called program.

4. The method for modeling and drawing a stamping die according to claim 1, characterized in that: The step S3 includes the following steps: Step S31, loading the image file. After the program is started, the image file path passed by the interface program is first obtained from the parameter list of the entry function mian, and the image file data is loaded through the function provided by NXOpen Api; Step S32, obtaining serialization information, and reading the handle information of all selected parts from the generated .bin file on the specified path; Step S33, marking the part entity, obtaining all selected parts from the loaded drawing file according to the handle information through the function provided by NXOpen Api, and marking the part entity with the attribute name selected; Step S34, using the function provided by NXOpen Api, obtain the layer attributes of each part entity, group the parts with the same layer into one group, and store all the groups in the list groupList; Step S35, traverse the list and call the working program to process each group of parts: take out each group in turn, create a temporary drawing file through NXOpenApi to link all the part entities in the group to the zero-time drawing file, and save the zero-time drawing file to the specified path of the local disk; create a process to start the working program drawer.exe through the function provided by Windows api, and store the process handle in a data table processMap of a map structure type; Step S36, task check. When the task is assigned and all subprocesses exit the active state, check whether there is a DWG drawing file named corresponding to each layer of parts in the specified file directory through the method provided by the C++ standard library. If the file does not exist, it means that the task has failed. Then start the working process again, reallocate the failed task for execution, and then check whether the drawing file corresponding to the task is generated after completion. If the task fails for the second time, all the output parts of the task layer are executed separately to filter out the failed parts, and the number and layer information of the failed parts are recorded in a local txt file in the form of a log. After the program ends, open the file and display it to the user for reading.

5. The method for modeling and drawing a stamping die according to claim 1, characterized in that: The step S4 includes the following steps: Step S41, loading the task file. When the working program drawer.exe is started, the task file path **.prt passed is obtained through the parameter list of the program entry function main and the file is opened through the unfun api to load the part data into the memory; Step S42, read the configuration table, load the basic attribute configuration table, tolerance configuration table, feature annotation table and design standard table; Step S43, read part attribute information, and obtain all attribute names specified by the user; Step S44, feature analysis, including plane slot analysis, through slot analysis, countersunk hole analysis and tooth hole analysis; Step S45, processing annotation matching, read all the information in the feature annotation configuration table, match the corresponding processing annotation entries to all the features stored in the SlotPlannarStructList, TongCaoStructList, ScrewWhitHeadStructList, ScrewStructList and other lists according to the type, structure, color, layer, diameter and other data of the feature, and fill in the parameters of the diameter and depth of each feature into the entry; Step S46, drawing; Step S47, exporting the dwg file. After all parts of the current layer are drawn, the current drawing page is exported to the specified path to save the dwg file through the interface NXOpen::DxfdwgCreator provided by NXOpen.

6. A stamping die modeling and drawing method according to claim 5, characterized in that: The mapping in step S46 includes the following steps: Step S461, create a drawing, reserve a view area of ​​10000 in width and height for each part, and then according to the number of parts in the current layer viewCount, obtain the width of the drawing sheetW = viewW*viewCount, and the height sheetW = viewH; then create the drawing through the function UF_DRAW_create_drawing; Step S462: Create a temporary view according to the view matrix, and traverse each output part in turn: Step S463, calculate the view layout, calculate the projection coordinates of each view of the part and the length and width of the area occupied by all views according to the length, width and height information of the part, and then calculate the actual frame size according to the ratio of the frame; then scale the size of the frame standard font according to the ratio of the standard frame size and the actual frame size, and obtain the annotation font size fontSize of the current part view; Step S464, projection view, first hide all parts and only display the current drawing part; then use the function UF_DRAW_import_view to project the temporary view of the part created previously into a 2D view as the main view mainView of the part; then use the function UF_DRAW_add_orthographic_view to project the side view of the part based on the main view mainView; Step S465, primitive annotation, integrating the processing annotations of all features in the lists such as SlotPlannarStructList, TongCaoStructList, ScrewWhitHeadStructList, ScrewStructList, etc., classifying and counting the features with the same annotation terms, and sorting the features with the same primitive letters but different terms, and splicing the serial numbers after the letters as the annotated primitives; Step S466, create a processing annotation. When the overall height of the annotation + the overall height of the view < the overall length of the view × 0.75, the annotation is placed at the lower left corner of the view area; when the overall height of the annotation < the height of the front view, the annotation is placed on the right side of the front view; when the overall height of the annotation < the overall height of the view, the annotation is placed on the right side of the view area; when the overall height of the annotation > the overall height of the view, and the overall height of the view < the overall length of the view, the annotation is divided into multiple blocks and placed below the view area; when the overall height of the annotation > the overall height of the view, and the overall height of the view > the overall length of the view, the annotation is divided into multiple blocks and placed on the right side of the view area; Step S467, set the view style and extract the view curve.

7. A control system for stamping die modeling and mapping, used in the stamping die modeling and mapping method according to any one of claims 1 to 6, characterized in that: include: Configuration information unit, used to configure processing standards; The human-computer interaction interface unit is used to select the output format and fill in the public information, and to serialize the public information and customer configuration information on the interface into a ui.bin file; The task allocation unit is used to mark all selected parts by attributes according to the information in the ui.bin file, and link all parts to a temporary part temp.part by layer for use by the sub-process; create multiple sub-processes and assign tasks to the sub-processes; maintain the sub-process list at the same time, monitor the status of the sub-process, clear the end process and add a new process; Execute task units to perform feature analysis, annotation matching, view projection and layout of parts, and finally export DWG files.

8. A computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the modeling and drawing method of the stamping die as described in any one of claims 1 to 6.

9. An electronic device, wherein: The electronic device comprises: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the modeling and drawing method of the stamping die according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for on-line monitoring transformer substation based on multi-process architecture

    CN105096210A

  • Parallel method and system for vector space overlay analysis in geographic information system

    CN107066542A

  • Three-dimensional CAD model parallel driving method based on process scheduling

    CN115509737A

  • Multi-process industrial design software simulation method and device built based on instruction set architecture

    CN117932980A

  • Automatic dynamic mapping method for tunnel section through drilling and blasting method

    CN118070378A