Development of engineering drawing automation generation software based on Pro/E (3)


Fourth, the annotation generation examples and procedures

In TOOLKIT, comments are stored in the smallest line of the Note Line. Different lines of text form a Note Data. For these comment blocks, the function ProDtlnoteCreate() can be used to generate comments. Displayed anywhere in the drawing. For the displayed characters, you can change its color, font and tilt by setting different parameters. In the example, information such as the technical requirements of the axis is generated on the drawing by calling the user-defined annotation generation function UsrNoteCreate(). The specific function is as follows:

UsrNoteCreate()
{
ProDtlnote note;
ProDtlnotetextHeightSet(text, height);
ProDtlnotetextWidthSet(text, -1.0);
ProDtlnotetextSlantSet(text, 0.0); //Set the height, width, and slope of the annotation font
ProDtlnotetextThicknessSet(text, 0.0);//Set the font weight
ProStringToWstring(font, 袒ont?;
ProDtlnotetextFontSet(text, font); //Set the font type
ProStringToWstring(wstr, note_text); //note_text stores the string to be displayed
ProDtlnotetextStringSet(text, wstr);
ProDtlnotelineAlloc(&line);
ProDtlnotelineTextAdd(line, text); //Assign storage space for text lines
ProDtlnotedataAlloc(drawing, &ndata);
ProDtlnotedataLineAdd(ndata, line);//For (6) Head 峙 洌 洌 洌 . . . . . . . . . . Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro Pro
ProDtlattachAlloc(PRO_DTLATTACHTYPE_FREE, NULL, pos_note, NULL, &attach);
ProDtlnotedataAttachmentSet(ndata, attach);
ProDtlattachAlloc(PRO_DTLATTACHTYPE_PARAMETRIC, NULL, NULL, surf_sel,
&leader);
ProDtlnotedataLeaderAdd(ndata, leader);
ProDtlnoteCreate(drawing, NULL, ndata, ¬e);
ProDtlnoteShow(¬e);//finally generate a comment and display the string in it
ProDtlnotedataFree(ndata);//release the previously allocated memory space
Return();
}

Five, the generation of other special symbols

TOOLKIT provides the most basic two-dimensional graphics generation function ProDtlentityCreate(), which is generated in a similar way to the generation of text annotations. A straight line or arc curve can be easily drawn by calling the arc initialization function ProArcdataInit() or the line initialization function ProLinedataInit(). Take the arc generation as an example, the program is as follows:

UsrCircleentityCreate()
{
ProVector start_pos, end_pos;
Double start_angle, end_angle, start_angle, end_angle ;
ProDtlentitydataAlloc(drawing, &edata);//Assigning element storage space
ProCurvedataAlloc(&curve); //Assign arc storage space
ProArcdataInit(start_pos,end_pos,center,start_angle,end_angle,radius,curve);// Initialization of arc: set start point, end point, start angle, stop angle and radius
ProDtlentitydataCurveSet(edata, curve);
Entity_color.method = PRO_COLOR_METHOD_TYPE;
Entity_color.value.type = color;
ProDtlentitydataColorSet(edata, &entity_color);//Set the line color of the arc
ProDtlentityCreate(drawing, NULL, edata, entity);//Generate arc
ProDtlentitydataFree (edata); / / free up memory space
Return ();
}

With the help of the above graphic generation function, some special symbols or simple sectional graphics can be generated. In the examples, this method is applied to achieve the annotation of roughness, concentricity, parallelism, and the like.

Previous page next page

Switchable Glass

Switchable Glass,Electrochromic Glass,Smart Glass Windows,Switchable Smart Glass

Huaian Hongrui Glass Co.,Ltd , https://www.hongruiglass.com

This entry was posted in on