Research on automatic coordinate dimensioning system in mold CAD system
Abstract: Dimensioning of mold drawings is a time-consuming and laborious work. In dimensioning, there are usually defects such as improper density of dimension lines, non intuitive dimensioning, and complex drawings. Based on these shortcomings, this paper studies an efficient and intelligent coordinate dimension automatic annotation system. This paper focuses on the core algorithms of the system, such as intelligent point selection, automatic generation of dimension lines, prevention of dimension line interference, the key technology of secondary development using ObjectARX in VC environment, and the design method of dynamically organizing and managing graphic data using data link list
Keywords: coordinate dimensioning; Linked list; ObjectARX
0 Introduction
in recent years, China has made great progress in the research of mold cad/cam. Many universities and scientific research institutions have launched some mold cad/cam systems, but these systems often have various shortcomings, one of which is in the generation of engineering drawings. Because the mold design ultimately provides a complete engineering drawing, which includes the correct view relationship and complete dimensions, technical requirements and parts list. Taking the general moderately complex progressive die system as an example, its drawing workload is often more than 100, and the working time is generally more than half a month. In the existing cad/cam, designers spend much more time on engineering drawings than on mold structure design. The main reason is that in the structural design, the information required for graphic annotation is not considered, and the drawing part is still manual labor on the computer to a large extent. At present, most enterprises at home and abroad still take the two-dimensional engineering drawings as the main basis for design, construction and inspection. According to the survey results, most of the domestic stamping dies are based on the product input of two-dimensional engineering drawings with three views. Therefore, an important sign of the advantages and disadvantages of CAD system is whether it can finally generate two-dimensional engineering drawings that make users satisfied flexibly, conveniently and time-saving. This paper mainly studies these problems, and develops an efficient and convenient engineering drawing generation system, which is mainly based on automatic annotation and supplemented by human-computer interaction. Based on the coordinate dimensioning method, this system develops a practical automatic dimensioning module on the AutoCAD2000 platform
1 system organization and implementation block diagram
dimensioning generally adopts two methods: traditional relative dimensioning and coordinate dimensioning. Figure 1 and Figure 2 show the comparison of traditional relative dimensioning and coordinate dimensioning methods. Coordinate dimensioning is a dimensioning method that marks the X and Y coordinate values of all nodes in the drawing relative to a given reference location point to reflect the geometric dimensions of all entities in the drawing. At present, the coordinate dimensioning method has been widely used in the mold industry, but the coordinate dimensioning function provided by AutoCAD itself has some shortcomings. When dimensioning, you need to manually select the points to be dimensioned one by one and manually determine the location of the dimension line. Aiming at these defects, the system selects all points to be marked at one time, and then automatically arranges the positions of all marking lines evenly, so as to realize efficient and intelligent marking
the relative size of Figure 1, especially the reconstruction of shanty towns and the infrastructure construction in the central and western regions, has been continuously increased. The annotation of Figure 2 coordinate dimension annotation
the whole system is realized by object-oriented programming technology in VC environment, in which surface gold decreases by 1.5% and silver decreases by 3.6%. The block diagram of automatic generation of coordinate dimensions is shown in Figure 3
Figure 3 coordinate size automatic generation block diagram
in the process of annotation, the first thing the system should do is to process the current drawing to obtain the entities that need to be annotated in the current part drawing. The excellent openness of AutoCAD makes it possible for people to query its internal graphic database, so as to obtain the graphic definition data of all entities that make up the part drawing. These data refer to the coordinates of the two ends of the line, the radius value of the circle/arc, the initial and final angle value of the arc, the polyline (which must be further divided into two kinds of entity data of line and arc), etc. after certain calculation, all the node sets to be marked in the part drawing are obtained; Filter and sort the obtained node set. The interior of the previously obtained node set is chaotic, and there are a large number of points with the same coordinate value. It is necessary to filter the node set and remove those redundant points, so that each node position on the part drawing is marked only once. Finally, dimension lines are automatically generated
2 core algorithm of the system
2.1 intelligent selection of point sets (see various basic entities in Figure 3)
coordinate dimensioning needs to deal with the coordinates of a large number of points. Therefore, an algorithm that can quickly obtain the point sets that need to be marked should be selected
(1) call the ARX function acedssget() to prompt the user to select the entity object to be labeled, so that the system returns all the objects to be labeled. According to users' habits, set up a preprocessing interactive dialog box to select word height, color, annotation direction, whether it is necessary to automatically annotate circles and arc segments, etc
(2) define an initial entity data point set in the form of a linked list (including the starting point and the center point), sort the X and Y coordinates of these points, and get the initial xmax, xmin, ymax, and Ymin to determine the basic range of the annotation field (generally select the rectangular area according to the overall aesthetic effect)
(3) call the function acedsslength() to obtain the number of entities. According to the function cast() provided by ACRX class, the entities are divided into four categories: circle, arc, line segment and polyline. Filter out thread lines, fillets, chamfers, and tangents based on rules. The following specific analysis:
1) when the return value of the function acdbarc ∷ cast (pent) is not null, an arc entity data point set in the form of a linked list is generated. First, consider the thread line, and use the extended data function xdata() to process the thread line. The method of determining various data points of the arc entity is the same as the definition of the initial linked list in the above 2. Because the initially formed dimension field is only obtained by comparing the attribute points of each entity in the initial linked list, and for the particularity of the arc, in addition to the endpoint, some points on the arc may be outside the existing dimension range, so it is necessary to compare whether the rectangular region of the arc segment is completely included in the dimension field. If not, redefine the dimension range and replace the existing xmax, xmin, ymax, and Ymin
2) when the return value of the function acdbcircle ∷ cast (pent) is not null, the point set of entity data of the circle is generated. Select the center of the circle as the annotation point to realize the annotation of the circle, and then compare the rectangular annotation field of the circle with the existing annotation field to update the annotation range
3) when the return value of the function acdbline ∷ cast (pent) is not null, a point set of line data is generated
4) when the return value of the function acdbpolyline ∷ cast (pent) is not null, a point set of polylines is generated. The polysemous lines are divided into lines and arcs, and the linked lists of lines and arcs are generated respectively. The attribute points of polysemous lines are obtained by accessing the linked lists one by one, so as to carry out annotation. Due to the influence of arc segment, the points that may be out of bounds must be considered. Therefore, the boundary points of polysemy should be used to compare with the existing annotation domain. Straight line segment does not need to consider "out of bounds" 17. Experimental conditions [method]. In this way, the size of the annotation field required for annotation is finally determined
2.2 automatic generation of dimension lines
when various point sets are intelligently selected, dimension lines can be positioned and generated. The defining datum point required for coordinate dimensioning can be any point, or it can be defined by the user himself. If this point is not in the generated point set, it is added to the point set. There are three standards for dimension lines (divided into long, medium and short). The default is the short dimension line (that is, the length of the dimension line from the boundary point, which is a fixed value). In the dialog box, the user is defined with four annotation directions (divided into four directions: up, down, left and right). The direction dividing algorithm is:
(1) get xmax, xmin, ymax and Ymin from the intelligently selected point set. In this way, imagine a rectangular annotation field (not drawn during annotation), from which coordinate annotation lines are derived. The intersection of the diagonal of this imaginary rectangle is the center of the annotation domain. The company has become the world's largest resonator shell manufacturer (xmid, Ymid)
(2) considering the habits of users, when classifying point sets, they are first divided into horizontal and vertical categories. If the user chooses to mark only two directions, mark it directly, otherwise go to (3) and (4)
(3) compare the X coordinates of the point in the obtained horizontal point set with the center point. When x>xmid, the direction of the labeled leader is right, when x
Copyright © 2011 JIN SHI