CN112419481B - Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing - Google Patents

Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing Download PDF

Info

Publication number
CN112419481B
CN112419481B CN202011301917.7A CN202011301917A CN112419481B CN 112419481 B CN112419481 B CN 112419481B CN 202011301917 A CN202011301917 A CN 202011301917A CN 112419481 B CN112419481 B CN 112419481B
Authority
CN
China
Prior art keywords
surface roughness
dimension
container
horizontal
interference
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
CN202011301917.7A
Other languages
Chinese (zh)
Other versions
CN112419481A (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.)
GUILIN FUDA CO Ltd
Guilin University of Electronic Technology
Original Assignee
GUILIN FUDA CO Ltd
Guilin University of Electronic Technology
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 GUILIN FUDA CO Ltd, Guilin University of Electronic Technology filed Critical GUILIN FUDA CO Ltd
Priority to CN202011301917.7A priority Critical patent/CN112419481B/en
Publication of CN112419481A publication Critical patent/CN112419481A/en
Application granted granted Critical
Publication of CN112419481B publication Critical patent/CN112419481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2004Aligning objects, relative positioning of parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Containers Having Bodies Formed In One Piece (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method for modifying and adaptively adjusting the surface roughness of engineering drawings in batches, which comprises two parts, wherein the first part is in a labeling form for modifying the surface roughness in batches, the second part is in adaptive adjustment of the surface roughness, and the two parts are combined with each other to realize the batch modification and the adaptive adjustment of the surface roughness of the engineering drawings. The method effectively solves the problem of old surface roughness label symbols in old drawing paper and the problem of interference between surface roughness and dimension lines by utilizing an API function provided by three-dimensional modeling software.

Description

Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing
Technical Field
The invention relates to the technical field of two-dimensional engineering drawing, in particular to a method for modifying and adaptively adjusting the surface roughness of engineering drawings in batches.
Background
In the prior art, the old drawing paper has the problems of old surface roughness mark symbols and interference between surface roughness and dimension lines, and a drawing standard interference situation schematic diagram in the prior art is shown as fig. 1.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a batch modification and adaptive adjustment method for the surface roughness of engineering drawings.
The technical scheme for realizing the purpose of the invention is as follows:
a method for modifying and adaptively adjusting the surface roughness of engineering drawings in batch comprises the following steps:
1) changing the marking form of the surface roughness in batches:
1-1) acquiring a first view in a two-dimensional engineering drawing;
1-2) traversing all surface roughness objects in the first view, wherein an API Interface of the surface roughness in Solidworks is ISFSymbol Interface, a return value of a GetSymbol () method under the Interface obtains the type of the surface roughness in an enumeration way, and when the return value is 0, 1, 2, 9, 8 and 7, the type corresponds to a basic type of the surface roughness, a required cutting machining type, a forbidden cutting machining type, a required JIS cutting machining type, a JIS basic type and a forbidden JIS cutting machining type respectively; when the return value is 8, the marking form of the surface roughness is an old marking form, a container jscccxh is defined, and the old marking form of the surface roughness is put into the container jscccxh;
1-3) obtaining character strings of surface roughness components by a GetTest () method according to the obtained old labeling form of the surface roughness; the surface roughness includes a 1 Maximum roughness, a 2 Minimum roughness, b machining method, c sampling length, d roughness interval, e removal material coefficient and f other roughness 7 parts;
1-4) setting the type of the surface roughness and the marking part of the surface roughness by utilizing a SetSymbol () method and a SetText () method according to the corresponding relation between the old marking form of the surface roughness and the national standard surface roughness of the new edition;
1-5) after the first view finishes modifying the labeling form of the surface roughness in batch, entering the next view by using an IGetNextView () method, and circularly scanning the surface roughness object on the view until the view scanning adjustment is finished;
2) the adaptive position adjustment of the dimension line comprises the following steps:
2-1) in a template of a Solidworks engineering drawing, each view has a corresponding view frame, horizontal and vertical coordinates of the left lower corner and the right upper corner of the view frame are obtained by a GetOutline () method in a view interface, a dimension line is divided into a regular dimension layer and an irregular dimension layer by taking the view frame as a boundary, the dimension line outside the view frame has hierarchy, the dimension line inside the view frame is relatively disordered and has no regularity, and the dimension line can be adjusted only when the interference problem occurs;
2-2) traversing all dimension line objects, obtaining coordinates of two arrows of the dimension lines by using a GetAlowHeadAtIndex 2() method, respectively placing a horizontal and vertical coordinate of a first arrow of the dimension lines into a container ccxx1 and a container ccxy1, respectively placing a horizontal and vertical coordinate of a second arrow of the dimension lines into a container ccxx2 and a container ccxy2, and recording a serial number of each dimension line into a container ccxxh, traversing the dimension lines, dividing the dimension lines into a horizontal dimension, a vertical dimension and other dimensions according to the following formula (1) and formula (3), placing a vertical dimension serial number i into a container szxh, placing a horizontal dimension serial number j into a container spxh, bounding a view frame, layering three regions in the horizontal direction and three regions in the vertical direction of the dimension lines according to the vertical coordinate of the horizontal dimension and the horizontal coordinate of the vertical dimension, respectively placing a length of the vertical dimension into a container sz 1 cd for each region according to formula (2), szcd2 and szcd3 and putting vertical size serial numbers into containers szxh1, szxh2 and szxh3, respectively, putting lengths of horizontal size into containers spcd1, spcd2 and spcd3 and putting horizontal size serial numbers into containers spxh1, spxh2 and spxh3, respectively, arranging numbers in the size length containers from small to large using the sort () function in c + +, resulting in layered horizontal size length containers (spcd10, spcd20 and spcd30) and layered vertical size length containers (szcd10, szcd20 and szcd 573 5), and recording original serial numbers of horizontal size (containers spxh10, spxh20 and spxh30) and vertical size (containers szxh 635924, szxh 599 and szxh 599);
ccxx1[i]=ccxx2[i] (1)
szcd[i]=|ccxy1[i]-ccxy2[i]| (2)
ccxy1[j]=ccxy2[j] (3)
spcd[j]=|ccxx1[j]-ccxx2[j]| (4)
2-3) adjusting the dimension line by utilizing a SetPosition () method according to a regular layout mode of the dimension line outside a view frame;
3) the method comprises the following steps of self-adaptive position adjustment of surface roughness, wherein the marking form of the marking degree of the surface roughness comprises the steps of directly marking on the surface of a contour and connecting a lead to other positions of a drawing on the surface of the contour, and the method specifically comprises the following steps:
3-1) firstly obtaining two labeling forms distinguished by whether an arrow exists on the surface roughness according to a GetAlowHeadCount () method under a surface roughness interface, and obtaining a surface roughness vertex coordinate A by utilizing a GetPosition () method 0 、B 0
3-2) when the surface roughness is directly marked on the surface of the profile, obtaining the angle alpha of the surface roughness by utilizing a GetAngle () method, and marking the default size of characters according to the default size of the surface roughness symbol of Solidworks,
Figure GDA0003730599680000031
Length and surface roughness of horizontal position A 0 B 0 An angle β with respect to the profile surface;
3-3) calculating B' according to the following formula (5) and formula (6) 0 Traversing all roughness objects, processing the surface roughness of the two marking forms separately, and marking the first reference point A of the surface roughness of the contour surface 0 The abscissa of (a) is put into a container ccdx1, and the ordinate is put into a container ccdy 1; a second reference point B 0 Is placed in a container ccdx2 on the abscissa and in a container ccdy2 on the ordinate, and the surface roughness number is recorded in a container ccdxh1 as A 0 B 0 Judging whether the interference with the dimension line exists in the engineering drawing or not as a reference line of the surface roughness;
Figure GDA0003730599680000032
Figure GDA0003730599680000033
3-4) when the surface roughness is marked to the engineering drawing in the form of lead, obtaining A by using a GetAlowHeadAtIndex 2() method 1 Coordinates, first reference point A of surface roughness, marking this form 1 The abscissa of (a) is put into a container ccd1x1, and the ordinate is put into a container ccd1y 1; second reference point B 1 The abscissa of (a) is placed in a container ccd1x2, and the ordinate is placed in a container ccd1y 2;
3-5) in the engineering drawing, considering the interference condition in the drawing as the problem of line segment intersection, obtaining the specific coordinates of each dimension, surface roughness and geometric tolerance on the drawing according to the API provided by Solidworks, and judging whether the interference condition exists in the drawing; judging the intersection condition of two line segments under a Solidworks default coordinate system;
3-6) judging whether an interference relationship exists in the dimension line according to the obtained coordinates of two arrows with the dimension and the coordinates of two datum points with the surface roughness, when the surface roughness is positioned on the contour surface, putting the interference dimension serial number into a container gscccx 1, putting the interference surface roughness serial number into a container gscccd 1, judging whether the dimension line is the horizontal dimension or the vertical dimension according to the interference dimension serial number and judging the position of the area where the dimension line is positioned, judging the angle of the surface roughness according to the surface roughness serial number, as shown in figure 4, dividing the view into a horizontal area (a) and a vertical area (a) according to a view frame, positioning the point (a) and the vertical area (a) according to the view frame, when the interference occurs in the horizontal area (a), traversing the area (a) by taking the longitudinal coordinate of the second datum point with the surface roughness as the horizontal dimension of the current interference, and traversing the horizontal coordinate in the area (a) containing the interference dimension line, respectively adjusting the dimension lines in the third area, namely adding a fixed value to the ordinate of each dimension line in the third area and reducing the fixed value to the ordinate of each dimension line in the third area; when the interference occurs in the vertical area (c), the adjusting method is consistent with the horizontal area;
3-7) when the interference occurs in the second area, adjusting the horizontal size and the vertical size according to the second datum point of the interference surface roughness as a positioning point, when the surface roughness is positioned in a lead mode, putting the interference size serial number into a container gscccx 2, putting the interference surface roughness serial number into a container gscdd 2, dividing the view into four areas I, II, III and IV by using a view central point P, when the first datum point of the interference surface roughness is in the area I, judging whether an interference size line is the horizontal size and the vertical size, when the size line is the horizontal size, driving the surface roughness by a SetPosition () method and moving the surface roughness to the right by a certain fixed value, when the size line is the vertical size, driving the surface roughness and moving the surface roughness to the upper by a certain fixed value, circularly judging the interference until no interference occurs, and stopping the cycle; in the areas II, III and IV, the judgment principle of the area I is adopted, the area is determined by the first datum point of the surface roughness, and the translation direction is determined by the horizontal dimension and the vertical dimension.
In step 3-5), the intersection of the two line segments includes the following conditions:
(1) when the slopes of two straight line pairs exist, calculating projection points of each point on the other straight line along the y-axis direction, namely A ', B', C ', D', and if (w1-y1) (w2-y2) < & (w3-y3) ((w 4-y4) < & (w3-y3) <0), intersecting;
(2) when the slope of the straight line AB is absent (i.e., x1-x 2) and the slope of the CD is present, the projection points a ', B' of the points a, B on the straight line of the CD along the y-axis are calculated, and if (w1-y1) · (w2-y2) & (x3-x1) · (x4-x1) · 0, the points a, B intersect;
(3) when the slope of the straight line CD is absent (i.e., x3-x 4) and the slope of AB is present, calculating the projection points a ', B' of the points C and D on the AB straight line along the y axis, and intersecting if (w3-y3) (w4-y4) < & (x1-x3) ((x 2-x3) < ═ 0);
(4) when none of the slopes is present, the crossing is made if (x1 ═ x3) & ((y3-y1) ((y3-y 2) < ═ 0| (y4-y1) (y4-y2) < ═ 0).
According to the method for batch modification and self-adaptive adjustment of the surface roughness of the engineering drawing, provided by the invention, the problem of old surface roughness mark symbols in old drawing paper and the problem of interference between the surface roughness and a dimension line are effectively solved by utilizing the API function provided by three-dimensional modeling software.
Drawings
FIG. 1 is a schematic diagram of a drawing standard interference scenario existing in the prior art;
FIG. 2 is a flow chart of the method of the present invention;
FIG. 3 is a schematic view of the surface roughness type;
FIG. 4 is a view information diagram;
FIG. 5 is a schematic diagram of a surface roughness marking method;
FIG. 6 is a schematic diagram of the components of the surface roughness;
FIG. 7 is a schematic diagram of the intersection of two line segments;
FIG. 8 is a view zone diagram;
FIG. 9 is an interference view of the valve body;
fig. 10 is an adjusted view of the valve body.
Detailed Description
The invention will be further elucidated with reference to the drawings and examples, without however being limited thereto.
Example (b):
as shown in fig. 2, a method for batch modification and adaptive adjustment of surface roughness of engineering drawings comprises the following steps:
1) changing the marking form of the surface roughness in batches:
1-1) acquiring a first view in a two-dimensional engineering drawing;
1-2) traversing all surface roughness objects in the first view, wherein the API Interface of the surface roughness in Solidworks is ISFSymbol Interface, the return value of GetSymbol () method under the Interface obtains the type of the surface roughness in an enumeration way, and when the return value is 0, 1, 2, 9, 8 and 7, the basic type, the required cutting type, the forbidden cutting type, the required JIS cutting type, the JIS basic type and the forbidden JIS cutting type of the surface roughness respectively correspond to as shown in FIG. 3; when the return value is 8, the marking form of the surface roughness is an old marking form, a container jscccxh is defined, and the old marking form of the surface roughness is put into the container jscccxh;
1-3) obtaining character strings of surface roughness components by a GetTest () method according to the obtained old labeling form of the surface roughness; the surface roughness includes a 1 Maximum roughness, a 2 Minimum roughness, b process, c sample length, d roughness interval, e remove material systemNumber and f other roughness 7 parts;
1-4) setting the type of the surface roughness and the marking part of the surface roughness by utilizing a SetSymbol () method and a SetText () method according to the corresponding relation between the old marking form of the surface roughness and the national standard surface roughness of the new edition;
1-5) after the first view finishes modifying the labeling form of the surface roughness in batch, entering the next view by using an IGetNextView () method, and circularly scanning the surface roughness object on the view until the view scanning is finished;
2) the adaptive position adjustment of the dimension line comprises the following steps:
2-1) in a template of a Solidworks engineering drawing, each view has a corresponding view frame, as shown in FIG. 4, the GetOutline () method in a view interface is used for obtaining horizontal and vertical coordinates of the left lower corner and the right upper corner of the view frame, the view frame is used as a boundary to divide a dimension line into a regular dimension layer and an irregular dimension layer, the dimension lines outside the view frame have hierarchy, the dimension lines inside the view frame are relatively disordered and have no regularity, and the dimension lines can be adjusted only when the interference problem occurs;
2-2) traversing all dimension line objects, obtaining coordinates of two arrows of the dimension lines by using a GetAlowHeadAtIndex 2() method, respectively placing a horizontal and vertical coordinate of a first arrow of the dimension lines into a container ccxx1 and a container ccxy1, respectively placing a horizontal and vertical coordinate of a second arrow of the dimension lines into a container ccxx2 and a container ccxy2, and recording a serial number of each dimension line into a container ccxxh, traversing the dimension lines, dividing the dimension lines into a horizontal dimension, a vertical dimension and other dimensions according to the following formula (1) and formula (3), placing a vertical dimension serial number i into a container szxh, placing a horizontal dimension serial number j into a container spxh, bounding a view frame, layering three regions in the horizontal direction and three regions in the vertical direction of the dimension lines according to the vertical coordinate of the horizontal dimension and the horizontal coordinate of the vertical dimension, respectively placing a length of the vertical dimension into a container sz 1 cd for each region according to formula (2), szcd2 and szcd3 and putting vertical size serial numbers into containers szxh1, szxh2 and szxh3, respectively, putting lengths of horizontal size into containers spcd1, spcd2 and spcd3 and putting horizontal size serial numbers into containers spxh1, spxh2 and spxh3, respectively, arranging numbers in the size length containers from small to large using the sort () function in c + +, resulting in layered horizontal size length containers (spcd10, spcd20 and spcd30) and layered vertical size length containers (szcd10, szcd20 and szcd 573 5), and recording original serial numbers of horizontal size (containers spxh10, spxh20 and spxh30) and vertical size (containers szxh 635924, szxh 599 and szxh 599);
ccxx1[i]=ccxx2[i] (1)
szcd[i]=|ccxy1[i]-ccxy2[i]| (2)
ccxy1[j]=ccxy2[j] (3)
spcd[j]=|ccxx1[j]-ccxx2[j]| (4)
2-3) adjusting the dimension line by utilizing a SetPosition () method according to a regular layout mode of the dimension line outside a view frame;
3) the surface roughness adaptive position adjustment, the marking form of the marking degree of the surface roughness includes directly marking on the contour surface and connecting a lead to other positions of the drawing on the contour surface, as shown in fig. 5, specifically includes the following steps:
3-1) firstly obtaining two labeling forms distinguished by whether an arrow exists on the surface roughness according to a GetAlowHeadCount () method under a surface roughness interface, and obtaining a surface roughness vertex coordinate A by utilizing a GetPosition () method 0 、B 1 As shown in fig. 5 and 6;
3-2) when the surface roughness is directly marked on the surface of the profile, obtaining the angle alpha of the surface roughness by utilizing a GetAngle () method, and marking the default size of characters according to the default size of the surface roughness symbol of Solidworks,
Figure GDA0003730599680000071
Length and surface roughness of horizontal position A 0 B 0 An angle β with respect to the profile surface;
3-3) according to the following formula (5) andformula (6) calculates B ″) 0 Traversing all roughness objects, processing the surface roughness of the two marking forms separately, and marking a first reference point A of the surface roughness of the contour surface 0 The abscissa of (a) is placed in a container ccdx1, and the ordinate is placed in a container ccdy 1; a second reference point B 0 Is placed in a container ccdx2 on the abscissa and in a container ccdy2 on the ordinate, and the surface roughness number is recorded in a container ccdxh1 as A 0 B 0 Judging whether the interference with the dimension line exists in the engineering drawing or not as a reference line of the surface roughness;
Figure GDA0003730599680000072
Figure GDA0003730599680000073
3-4) when the surface roughness is marked to the engineering drawing in the form of lead, obtaining A by using a GetAlowHeadAtIndex 2() method 1 Coordinates, first reference point A of surface roughness, marking this form 1 The abscissa of (a) is put into a container ccd1x1, and the ordinate is put into a container ccd1y 1; second reference point B 1 The abscissa of (a) is put into a container ccd1x2, and the ordinate is put into a container ccd1y 2;
3-5) in the engineering drawing, considering the interference condition in the drawing as the problem of line segment intersection, obtaining the specific coordinates of each dimension, surface roughness and geometric tolerance on the drawing according to the API provided by Solidworks, and judging whether the interference condition exists in the drawing; judging the intersection condition of the two line segments under a Solidworks default coordinate system; as shown in fig. 7, the intersection of two line segments includes the following cases:
(1) when the slopes of two straight line pairs exist, calculating projection points of each point on the other straight line along the y-axis direction, namely A ', B', C ', D', and if (w1-y1) (w2-y2) < ═ 0& (w3-y3) ((w 4-y4) < ═ 0), intersecting;
(2) when the slope of the straight line AB is absent (i.e., x1-x 2) and the slope of the CD is present, the projection points a ', B' of the points a, B on the straight line of the CD along the y-axis are calculated, and if (w1-y1) · (w2-y2) & (x3-x1) · (x4-x1) · 0, the points a, B intersect;
(3) when the slope of the straight line CD is absent (i.e., x3-x 4) and the slope of AB is present, calculating the projection points a ', B' of the points C and D on the AB straight line along the y axis, and intersecting if (w3-y3) (w4-y4) < & (x1-x3) ((x 2-x3) < ═ 0);
(4) when none of the slopes is present, the crossing is made if (x1 ═ x3) & ((y3-y1) ((y3-y 2) < ═ 0| (y4-y1) (y4-y2) < ═ 0).
3-6) judging whether the dimension lines have interference relationship according to the obtained coordinates of two arrows with the dimension and the coordinates of two datum points with the surface roughness, when the surface roughness is positioned on the contour surface, putting the interference dimension serial number into a container gscccx 1, putting the interference surface roughness serial number into a container gscccd 1, judging whether the dimension lines are in horizontal dimension or vertical dimension according to the interference dimension line serial number and judging the position of the area where the dimension lines are positioned, judging the angle of the surface roughness according to the surface roughness serial number, when the interference occurs in a horizontal area (c), taking the ordinate of the second datum point with the surface roughness as the positioning point of the current interference horizontal dimension, traversing the horizontal coordinate in the area (c) containing the horizontal dimension of the interference dimension lines, respectively adjusting the dimension lines in the area (c), namely adding a fixed value to the ordinate of each dimension line in the area (c), reducing a fixed value for the ordinate of each dimension line in the area III; when the interference occurs in the vertical area (c), the adjusting method is consistent with the horizontal area;
3-7) when the interference occurs in the second area, adjusting the horizontal size and the vertical size according to the second datum point of the interference surface roughness as a positioning point, when the surface roughness is positioned in a lead mode, putting the interference size serial number into a container gscccx 2, putting the interference surface roughness serial number into a container gscccd 2, dividing a view into four areas I, II, III and IV by a view central point P, as shown in figure 8, when the first datum point of the interference surface roughness is in the area I, judging whether the interference size line is the horizontal size and the vertical size, when the size line is the horizontal size, driving the surface roughness by a SetPosition () method and moving the surface roughness to the right by a certain fixed value, when the size line is the vertical size, driving the surface roughness and moving the surface roughness up by a certain fixed value, circularly judging the interference until no interference occurs, and stopping circularly; in the areas II, III and IV, the judgment principle of the area I is adopted, the area is determined by the first datum point of the surface roughness, and the translation direction is determined by the horizontal dimension and the vertical dimension.
The valve body interference view described in fig. 9 is adjusted using the method described above, and the adjusted view of the valve body is shown in fig. 10.

Claims (2)

1. A method for modifying and adaptively adjusting the surface roughness of engineering drawings in batch is characterized by comprising the following steps:
1) changing the marking form of the surface roughness in batches:
1-1) acquiring a first view in a two-dimensional engineering drawing;
1-2) traversing all surface roughness objects in the first view, wherein an API Interface of the surface roughness in Solidworks is ISFSymbol Interface, a return value of a GetSymbol () method under the Interface obtains the type of the surface roughness in an enumeration way, and when the return value is 0, 1, 2, 9, 8 and 7, the type corresponds to a basic type of the surface roughness, a required cutting machining type, a forbidden cutting machining type, a required JIS cutting machining type, a JIS basic type and a forbidden JIS cutting machining type respectively; when the return value is 8, the marking form of the surface roughness is an old marking form, a container jsccdxh is defined, and the old marking form of the surface roughness is put into the container jsccdxh;
1-3) obtaining character strings of surface roughness components by a GetTest () method according to the obtained old labeling form of the surface roughness; the surface roughness includes a 1 Maximum roughness, a 2 Minimum roughness, b machining method, c sampling length, d roughness interval, e removal material coefficient and f other roughness 7 parts;
1-4) setting the type of the surface roughness and the marking part of the surface roughness by utilizing a SetSymbol () method and a SetText () method according to the corresponding relation between the old marking form of the surface roughness and the national standard surface roughness of the new edition;
1-5) after the first view finishes modifying the labeling form of the surface roughness in batch, entering the next view by using an IGetNextView () method, and circularly scanning the surface roughness object on the view until the view scanning adjustment is finished;
2) the adaptive position adjustment of the dimension line comprises the following steps:
2-1) in a template of a Solidworks engineering drawing, each view has a corresponding view frame, horizontal and vertical coordinates of the left lower corner and the right upper corner of the view frame are obtained by using a GetOutline () method in a view interface, a dimension line is divided into a regular dimension layer and an irregular dimension layer by taking the view frame as a boundary, the dimension lines outside the view frame have hierarchy, the dimension lines inside the view frame are relatively disordered and have no regularity, and the dimension lines can be adjusted only when an interference problem occurs;
2-2) traversing all dimension line objects, obtaining coordinates of two arrows of the dimension lines by using a GetAlowHeadAtIndex 2() method, respectively placing a horizontal and vertical coordinate of a first arrow of the dimension lines into a container ccxx1 and a container ccxy1, respectively placing a horizontal and vertical coordinate of a second arrow of the dimension lines into a container ccxx2 and a container ccxy2, and recording a serial number of each dimension line into a container ccxxh, traversing the dimension lines, dividing the dimension lines into a horizontal dimension, a vertical dimension and other dimensions according to the following formula (1) and formula (3), placing a vertical dimension serial number i into a container szxh, placing a horizontal dimension serial number j into a container spxh, bounding a view frame, layering three regions in the horizontal direction and three regions in the vertical direction of the dimension lines according to the vertical coordinate of the horizontal dimension and the horizontal coordinate of the vertical dimension, respectively placing a length of the vertical dimension into a container sz 1 cd for each region according to formula (2), szcd2 and szcd3, and vertical size serial numbers are placed into containers szxh1, szxh2 and szxh3, respectively, lengths of horizontal sizes are placed into containers spcd1, spcd2 and spcd3, and horizontal size serial numbers are placed into containers spxh1, spxh2 and spxh3, respectively, according to formula (4), the numbers in the size length containers are arranged from small to large using the sort () function in c + +, resulting in layered horizontal size length containers spcd10, spcd20 and spcd30, and layered vertical size length containers szcd10, szcd20 and szcd30, and the original serial numbers of the horizontal sizes are recorded: containers spxh10, spxh20 and spxh30 and vertical size indices: containers szxh10, szxh20, and szxh 30;
ccxx1[i]=ccxx2[i] (1)
szcd[i]=|ccxy1[i]-ccxy2[i]| (2)
ccxy1[j]=ccxy2[j] (3)
spcd[j]=|ccxx1[j]-ccxx2[j]| (4)
2-3) adjusting the dimension line by utilizing a SetPosition () method according to a regular layout mode that the dimension line is outside a view frame;
3) the method comprises the following steps of self-adaptive position adjustment of surface roughness, wherein the marking form of the marking degree of the surface roughness comprises the steps of directly marking on the surface of a contour and connecting a lead to other positions of a drawing on the surface of the contour, and the method specifically comprises the following steps:
3-1) firstly obtaining two labeling forms distinguished by whether an arrow exists on the surface roughness according to a GetAlowHeadCount () method under a surface roughness interface, and obtaining a surface roughness vertex coordinate A by utilizing a GetPosition () method 0 、B 0
3-2) when the surface roughness is directly marked on the surface of the profile, obtaining the angle alpha of the surface roughness by utilizing a GetAngle () method, and marking the default size of characters according to the default size of the surface roughness symbol of Solidworks,
Figure FDA0003730599670000021
Length and surface roughness of horizontal position A 0 B 0 An angle β with respect to the profile surface;
3-3) calculating B 'from the following equations (5) and (6)' 0 Traversing all roughness objects, processing the surface roughness of the two marking forms separately, and marking the first surface roughness of the contour surfaceReference point A 0 The abscissa of (a) is placed in a container ccdx1, and the ordinate is placed in a container ccdy 1; a second reference point B 0 Is placed in a container ccdx2 on the abscissa and in a container ccdy2 on the ordinate, and the surface roughness number is recorded in a container ccdxh1 as a 0 B 0 Judging whether the interference with the dimension line exists in the engineering drawing or not as a reference line of the surface roughness;
Figure FDA0003730599670000031
Figure FDA0003730599670000032
3-4) when the surface roughness is marked to the engineering drawing in the form of lead, obtaining A by using a GetAlowHeadAtIndex 2() method 1 Coordinates, first reference point A of surface roughness, marking this form 1 The abscissa of (a) is placed in a container ccd1x1, and the ordinate is placed in a container ccd1y 1; second reference point B 1 The abscissa of (a) is placed in a container ccd1x2, and the ordinate is placed in a container ccd1y 2;
3-5) in the engineering drawing, considering the interference condition in the drawing as the problem of whether line segments intersect, obtaining the specific coordinates of each size, surface roughness and geometric tolerance on the view according to an API provided by Solidworks, and judging whether the interference condition exists in the drawing; judging the intersection condition of two line segments under a Solidworks default coordinate system;
3-6) judging whether the dimension line has interference relation according to the obtained coordinates of two arrowheads with dimension and the coordinates of two datum points with surface roughness, when the surface roughness is positioned on the contour surface, putting the interference dimension serial number into a container gscccx 1, putting the interference surface roughness serial number into a container gscccd 1, judging whether the dimension line is horizontal dimension or vertical dimension according to the interference dimension line serial number and judging the position of the area where the dimension line is positioned, judging the angle of the surface roughness according to the surface roughness serial number, dividing the view into a horizontal area (c) and a vertical area (c) according to a view frame, traversing the positioning point of the horizontal dimension of the current interference by using the ordinate of the second datum point with surface roughness when the interference occurs in the horizontal area (c), traversing the abscissa of the area (c) including the horizontal dimension of the interference dimension line, and respectively adjusting the dimension lines in the region (c), namely, a fixed value is added to the ordinate of each dimension line in the region I, and a fixed value is reduced to the ordinate of each dimension line in the region III; when the interference occurs in the vertical area (c), the adjusting method is consistent with the horizontal area;
3-7) when the interference occurs in the second area, adjusting the horizontal size and the vertical size according to the second datum point of the interference surface roughness as a positioning point, when the surface roughness is positioned in a lead mode, putting the interference size serial number into a container gscccx 2, putting the interference surface roughness serial number into a container gscdd 2, dividing the view into four areas I, II, III and IV by using a view central point P, when the first datum point of the interference surface roughness is in the area I, judging whether an interference size line is the horizontal size and the vertical size, when the size line is the horizontal size, driving the surface roughness by a SetPosition () method and moving the surface roughness to the right by a certain fixed value, when the size line is the vertical size, driving the surface roughness and moving the surface roughness to the upper by a certain fixed value, circularly judging the interference until no interference occurs, and stopping the cycle; in the areas II, III and IV, the judgment principle of the area I is adopted, the area is determined by the first datum point of the surface roughness, and the translation direction is determined by the horizontal dimension and the vertical dimension.
2. The method for batch modification and adaptive adjustment of the surface roughness of the engineering drawing according to claim 1, wherein in the step 3-5), the intersection of two line segments comprises the following conditions:
(1) when the slopes of two straight line pairs exist, calculating projection points of each point on the other straight line along the y-axis direction, namely A ', B', C ', D', and if (w1-y1) (w2-y2) < & (w3-y3) ((w 4-y4) < & (w3-y3) <0), intersecting;
(2) when the slope of the straight line AB is absent, i.e., x1 ═ x2, and the CD slope is present, the projection points a ', B' of points a, B on the straight line of the CD along the y axis are calculated, and if (w1-y1) & (w2-y2) & & (x3-x1) (. x4-x1) < &) 0, the points intersect;
(3) when the slope of the straight line CD is absent, i.e., x3-x 4 and the slope of AB is present, calculating the projection points a ', B' of the points C and D on the AB straight line along the y axis, and intersecting if (w3-y3) (w4-y4) < & (x1-x3) ((x 2-x3) < ═ 0);
(4) when none of the slopes is present, the crossing is made if (x1 ═ x3) & ((y3-y1) ((y3-y 2) < ═ 0| (y4-y1) (y4-y2) < ═ 0).
CN202011301917.7A 2020-11-19 2020-11-19 Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing Active CN112419481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011301917.7A CN112419481B (en) 2020-11-19 2020-11-19 Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011301917.7A CN112419481B (en) 2020-11-19 2020-11-19 Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing

Publications (2)

Publication Number Publication Date
CN112419481A CN112419481A (en) 2021-02-26
CN112419481B true CN112419481B (en) 2022-08-30

Family

ID=74773971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011301917.7A Active CN112419481B (en) 2020-11-19 2020-11-19 Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing

Country Status (1)

Country Link
CN (1) CN112419481B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344499A (en) * 2018-09-29 2019-02-15 中国航发哈尔滨轴承有限公司 Rolling bearing engineering drawing method based on VB
CN110148197A (en) * 2019-05-23 2019-08-20 桂林电子科技大学 A kind of two-dimensional engineering graphic size marking self-adapting regulation method
CN110428479A (en) * 2019-07-26 2019-11-08 桂林电子科技大学 A kind of Solid works two-dimensional engineering graphic size marking error correction self-adapting regulation method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001282861A (en) * 2000-03-31 2001-10-12 Honda Motor Co Ltd Graphic correction method in cad system and device therefor
US20190362034A1 (en) * 2018-05-28 2019-11-28 Chun-Sheng Chiang Design Method for Civil Engineering of Reality Scenery

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109344499A (en) * 2018-09-29 2019-02-15 中国航发哈尔滨轴承有限公司 Rolling bearing engineering drawing method based on VB
CN110148197A (en) * 2019-05-23 2019-08-20 桂林电子科技大学 A kind of two-dimensional engineering graphic size marking self-adapting regulation method
CN110428479A (en) * 2019-07-26 2019-11-08 桂林电子科技大学 A kind of Solid works two-dimensional engineering graphic size marking error correction self-adapting regulation method

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
A feasible approach to the integration of CAD and CAPP;Xionghui Zhou 等;《Computer-Aided Design》;20070430;第39卷(第04期);第324-338页 *
Parametric Design and Automatic Adjustment Technique of Engineering Drawing Based on SolidWorks;Jianpu Geng 等;《Advanced Materials Research》;20130613;第706-708卷;第1958-1962页 *
参教化工程图尺寸标注自动调整技术;陈乐 等;《机械设计与研究》;20160630;第32卷(第03期);第73-76页 *
基于HOOPS三维实体尺寸及公差的交互标注;李阳;《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》;20160315(第03期);第I138-7508页 *
基于Solidworks与VB.NET工程图自动调整方法研究及应用;肖雄 等;《重庆理工大学学报(自然科学)》;20200609;第34卷(第10期);第118-125页 *
基于变型设计的精度尺寸标注位置调整算法的研究;李雪梅 等;《机械研究与应用》;20100228(第10期);第117-120页 *
面向企业的国标化工程图技术研究;马静 等;《机械研究与应用》;20100228;第23卷(第01期);第17-120页 *

Also Published As

Publication number Publication date
CN112419481A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN107571506B (en) A kind of increasing material manufacturing method of adaptive layered
CN108121862B (en) Automatic engineering drawing labeling method based on three-dimensional geometric features
CN106326565B (en) Method for rapidly converting three-dimensional design engineering drawing
CN110968039B (en) Graph cutting and sorting processing method applied to laser cutting numerical control machining
CN106528937B (en) System and method for avoiding label information overlapping based on PDMS (polydimethylsiloxane) map
EP4331813A1 (en) Slicing method, printing method, and device and apparatus for mapping three-dimensional model
CN109726717B (en) Vehicle comprehensive information detection system
CN110428479B (en) Method for adaptively adjusting dimension marking error correction of two-dimensional engineering drawing of Solid works
CN115100191B (en) Metal casting defect identification method based on industrial detection
CN112419481B (en) Batch modification and self-adaptive adjustment method for surface roughness of engineering drawing
CN103413342B (en) A kind of pictograph gradual changed method based on pixel
CN109242858A (en) Pattern primitive dividing method is recycled based on the matched textile printing of adaptive template
US10571895B2 (en) Three-dimensional printing apparatus and three-dimensional printing method
CN112084973B (en) Tunnel pipe ring identification and labeling method based on orthographic projection image
CN109241555B (en) Multi-primitive Gerber file analyzing and drawing method for improving drawing precision
CN101764936B (en) Method for confirming shortest distance of pixel space mask code matrix from pixel to boundary
CN108724734B (en) Dense feature-based 3D pre-printing layering algorithm
CN104412187A (en) Method for evaluating and laser cutting machine
CN113111428B (en) Method for marking elevation by optimizing elevation of retaining wall elevation graph
CN111444903B (en) Method, device and equipment for positioning characters in cartoon bubbles and readable storage medium
CN112506474A (en) MBD model-based automatic programming method for on-machine measurement of 3D measuring head
CN110148197B (en) Adaptive adjustment method for dimension marking of two-dimensional engineering drawing
CN101764937B (en) Method for confirming distance of pixel space mask code matrix from pixel to outermost side
CN105773066B (en) The processing method of plane chamfering word
Gupta et al. Segmentation, modeling and classification of the compact objects in a pile

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