The project blueprint automation that is based on Pro/E builds the development of software

  • Time:
  • Click:48
  • source:PERFSO CNC Machining
One, introductive   Pro/ENGINEER is company of American parameter technology (PTC) the three-dimensional CAD/CAM software of development, TOOLKIT is a when PTC offers technically 2 development tool. In TOOLKIT, PTC provided library of large C language function to the user, through transferring these rock-bottom function, the user can be convenient and the database that visits Pro/ENGINEER surely and interior application process, undertake 2 times developing, a few more patulous specific function. Regard a kind of successful three-dimensional CAD/CAM as software, pro/ENGINEER had contained more efficient module giving a picture, the spare parts that can apply to any appearance gives graph job, but, for the requirement giving a picture with adjacent appearance of relatively similar to a few spare partses, geometry, many time the flower is in repeat decorate size of view, number to go up, the loss outweights the gain. In Pro/ENGINEER already undertook 2 times developing on foundations of some module giving a picture, suit this kind of situation more. Current, the product that designs in branch of a lot of designs has certain dependency, this makes the question that existence of process of a lot of designs repeats labor. Be based on this kind of reason, on Pro/ENGINEER2000i2 foundation, the author is participated in developed a relatively complete axis kind the spare parts is designed (three-dimensional model) , the spare parts gives graph, spare parts to machine (code of treatment knife course is generated) system, let a few current design processes realize automatic processing, in order to reduce the workload of design personnel (the article is emphasized only discuss among them spare parts to give graph share) . To hardware design, this system uses method of relatively simple a group of things with common features watch (namely beforehand manual compose builds product model, regard a group of things with common features watch as it kind belong to, control parameter to control the appearance bulk of the model individually in the definition in a group of things with common features watch next, pass the value that changes each parameter to get what what need derive in the program) . Give the programming of plan part to the spare parts, OK very conveniently hardware design is medium before the basis the parameter name of the definition will obtain corresponding axis kind spare parts appearance and dimension information. 2, view generates a method to analyse   1. The phenomenon such as jackknife of the interference between view, dimension produces in the process that blueprint area differentiates to be generated automatically in blueprint to avoid, can differentiate blueprint by the requirement beforehand a location. The axis with not quite complex external form of relatively similar to the structure, geometry kind spare parts, can divide whole blueprint into advocate view area, profile area, form area and annotate area. The section volume that decides according to place next reachs the place, adjust view scale, make relatively reasonable view. Can avoid the positional conflict between blueprint top view and dimension so. 2. Generate advocate the scale that the key that view and profile make view is affirmatory view direction and view. To view direction, if direction chooses a mistake, cannot convey the appearance of the spare parts correctly. Generate in what TOOLKIT offers advocate view (General View) in function, the directional matrix that can differ through the input (Orientation Matrix) will adjust view direction. To view scale, choose appropriate coefficient of proportionality, it is clear to can make view is conveyed as far as possible, won't cause cross the border again, generate area interference. To the axis kind spare parts, as a result of specific appearance feature, when making blueprint besides advocate the cutaway view that still needs to generate each keyway to be in outside view. The ViewCreate() of   of   of ProDrawingGeneral of view generating function that offers through calling TOOLKIT, the view that can create need conveniently (need attention: Decide in design phase of spare parts model appropriate acquiescent reference is planar, so OK the issue that considers way in oversight of phase giving a picture, namely directional matrix can be replaced with unit matrix; View scale acquiesces first for 1: 1) . On this foundation, the view outline that calls TOOLKIT to offer extracts function ProDrawingViewOutlineGet () , computation the outline size of this view, again good according to differentiating beforehand section volume, reset view scale, make the view with proper size automatically. 3. View generates example and program to be in this example, the axial model that the basis already built is hypostatic (Axis.

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.


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