The project blueprint automation that is based on Pro/E builds the development of software
- Time:
- Click:48
- source:PERFSO CNC Machining
Part) , use C language process designing, the view that calls TOOLKIT to offer is generated reach adjust function, make the blueprint that accords with a requirement, make view on this. The program is as follows: ProSolid Solid; Int Sheet; ProMdlCurrentGet(&solid);// obtains the axial model ProStringToWstring(wroot that opens in memory, "Drawing " ) ; ProObjectwindowCreate(wroot, PRO_DRAWING, &w_id);// opens a name to be the ProDrawingCurrentSheetSet(drawing of empty view window of Drawing, sheet);// installs ProDrawingSolidAdd(drawing of current plan layer, solid);// adds acquisition axial model current window ProWindowActivate(w_id);// to activation current window ProDrawingGeneralviewCreate(drawing, solid, sheet, 0, pos, scale, matrix, &view); // makes view on current plan layer, among them scale size Scale=1.
0, directional matrix Matrix is 3 Χ ProDrawingViewOutlineGet(drawing of 3 units matrix, view, outline);// acquires view outline bulk... ... ... .
/ / adjust Scale size ProDrawingViewdelet(drawing, view, 1);// deletes unreasonable view ProDrawingGeneralviewCreate(drawing, solid, sheet, 0, pos, scale, matrix, &view);// generates view ProDwgSheetRegenerate(drawing afresh according to adjustment scale size Scale, sheet);// refresh window, the view that redisplay generates 3, analysis of indication dimension method is in Pro/ENGINEER, hypostatic mode (the dimension that Part Mode) stores and in n/arc drafting (the dimension that founds in Drawing) is different idea, because this should show the measure of the spare parts,have the following two kinds of methods can come true. 1. New measure was generated to offer ProDrawingDimCreate() of dimension generating function in TOOLKIT in n/arc drafting mode, apply this function to be able to make all sorts of measure. But, this function asks to input more entrance parameter, include blueprint model (Drawing) , dimension datum (Dimension Attachments) , size type (ProDimSense) , tag text fixed position to nod (Dimension Text Location) etc. 2. The dimension that stores in hypostatic model shows directly in n/arc drafting mode offerred dimension to show function ProDimensionShow in TOOLKIT () , it is OK to use this function all sorts of measure that show the memory in hypostatic model conditionally in n/arc drafting mode, this also is the method of the indication model dimension of the acquiesce in Pro/ENGINEER cartography module. Be compared and character, the method of this kind of indication dimension is simpler and applicable, and the design thought according to facing treatment (DFM) , can be in design phase namely hypostatic modelling phase considers treatment, make the dimension information of the memory in hypostatic model contented treatment demand, satisfy in the demand that when giving a picture, indicates to dimension namely. 3. Dimension shows example and program are in this example, choose the 2nd kind of dimension to demonstrate a method. ProSolid Solid; ProSolidDimensionVisit(solid, - 1, (ProDimensionVisitAction)DimVisitAction01, (ProDimensionFilterAction)DimVisitFilter01, (ProAppData)&p_data);// alls over all sorts of dimension ProError DimVisitAction01(ProDimension *dimension in model of all previous substance, proError Status, dimension of Data *p_data) // handles function {ProDimensionShow(dimension, p_data->p_view, p_data->p_drawing, NULL); // dimension shows ProDrawingDimensionPosGet(p_data->p_drawing, dimension, location); // obtains acquiesce to tag text position ProDrawingDimensionMove(p_data->p_drawing, dimension, location_new); // shift tags text to arrive show dimension of emplacement} ProError DimVisitFilter01(ProDimension *dimension)// alls over all previous to filter function {Status = ... ... .
; // setting filters differently condition, make the dimension of different type OK of corresponding and different processing function Return (status); } 4, annotate generates example and program to be in TOOLKIT, annotate is go with text (Note Line) those who be the smallest location, diverse article one's line comprises an annotate piece (Note Data) , to these annotate piece, call function ProDtlnoteCreate() to be able to make explanatory note, show in any positional office of blueprint come. The parameter that can differ through the setting to indication character will change its color, font and gradient. In example, through calling the UsrNoteCreate() of annotate generating function that the user defines oneself, technology of unripe on blueprint axial asks to wait for information. Particular function is as follows: UsrNoteCreate() {ProDtlnote Note; ProDtlnotetextHeightSet(text, height); ProDtlnotetextWidthSet(text, - 1.
0); ProDtlnotetextSlantSet(text, 0.
0); // installs the ProDtlnotetextThicknessSet(text of tall, wide, gradient of annotate font, 0.
0);// installs ProStringToWstring(font of font degree of finish, Yao Ont? ; ProDtlnotetextFontSet(text, font); // installs font type ProStringToWstring(wstr, the memory in Note_text); //note_text needs indication string ProDtlnotetextStringSet(text, wstr); ProDtlnotelineAlloc(&line); ProDtlnotelineTextAdd(line, text); // allocates storage space ProDtlnotedataAlloc(drawing for article one's own profession, &ndata); ProDtlnotedataLineAdd(ndata, does Line);// occupy clear for Qi of ⑹ head stand erect does ⒓ blame Jia seek limit? ProDtlnotedataAngleSet(ndata, angle) ; 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);// makes explanatory note finally, show among them string ProDtlnotedataFree(ndata);// is released in front Return() of space of place distributive memory; } 5, the TOOLKIT of of law of unripe set prescription of other and special symbol offerred ProDtlentityCreate() of the basiccest generating function of 2 dimension graph, the law of unripe set prescription of law of its unripe set prescription and text annotate is similar. Through calling ProArcdataInit() of function of circular arc initialization ProLinedataInit() of function of linear perhaps initialization, can draw easily linear or circular arc curve. Generate with circular arc for exemple, the program is as follows: UsrCircleentityCreate() {ProVector Start_pos, end_pos; Double Start_angle, end_angle, start_angle, end_angle; ProDtlentitydataAlloc(drawing, &edata);// allocation pursues yuan of storage space ProArcdataInit(start_pos of space of storage of circular arc of ProCurvedataAlloc(&curve); // allocation, end_pos, center, start_angle, end_angle, radius, the initialization of Curve);// circular arc: Set start, terminal, initial point of view, break down angle and radius ProDtlentitydataCurveSet(edata, curve); Entity_color.
Method = PRO_COLOR_METHOD_TYPE; Entity_color.
Value.
Type = Color; ProDtlentitydataColorSet(edata, &entity_color);// installs ProDtlentityCreate(drawing of the line of circular arc color, NULL, edata, entity);// generates circular arc ProDtlentitydataFree(edata);// to release memory space Return () have the aid of of of; } at above graph generating function, can make the section plane figure with a few special simple perhaps symbols. In example, apply this kind of method to realize surface roughness, coaxial to spend those who reach parallelism to wait to tag. 6, the applied program that the program runs in Pro/ENGINEER environment to want to run him user (executable Exe file or file of Dll of dynamic link library) , must undertake registered to this program in Pro/ENGINEER. The Toolkit below Pro/ENGINEER installation catalog has a Protk in subdirectory.
Dat file, this is a standard register a document, the user needs to change what can generate his simply to register a document according to actual condition only. The program is as follows: NAME Drawing_application// applies of program name EXEC_FILE.
/ $PRO_MACHINE_TYPE/obj/drawing_application.
The executable program TEXT_DIR that Exe // user writes.
/ of Protk_appls/pt_install_test/text // STARTUPexe REVISION 18 END had after registering a document, can be in the AuxiliaryApplication dialog box of Pro/ENGINEER to load should register a document, with running designation applied program, in the starting catalog that also can register this the file to put Pro/ENGINEER, run Pro/ENGINEER every time so, the metropolis is automatic to load this file, run designation applied program. 7, last word article bat around the way of automatic unripe set prescription that the blueprint of spare parts project that is based on Pro/ENGINEER platform makes view of the spare parts in software, dimension, annotate wait, develop the relevant function that tool TOOLKIT provides through writing C language program to be called 2 times, specific realized Pro/ENGINEER platform upper shaft kind of blueprint of spare parts project generate automatically, changed traditional artificial way giving a picture thereby, great the work efficiency that improved design personnel. CNC Milling