3. View generation instance and program
In this example, based on the generated axis model entity (axis.part), the C language programming is used to call the view generation and adjustment functions provided by TOOLKIT to generate the required drawings and generate views on top of them. The procedure is as follows:
ProSolid solid;
Int sheet;
ProMdlCurrentGet(&solid);//Get the axis model opened in memory
ProStringToWstring(wroot, "drawing");
ProObjectwindowCreate(wroot,PRO_DRAWING,&w_id);//Open an empty view window named drawing
ProDrawingCurrentSheetSet(drawing, sheet);//Set the current layer
ProDrawingSolidAdd(drawing, solid);//Add the obtained axis model to the current window
ProWindowActivate(w_id);//activate the current window
ProDrawingGeneralviewCreate(drawing, solid,sheet,0,pos,scale,matrix,&view); //Generate a view on the current layer, where the scale size scale=1.0 and the direction matrix matrix is ​​3Χ3 unit matrix
ProDrawingViewOutlineGet(drawing,view,outline);//Get the view outline size................
/ / Adjust the size of the scale
ProDrawingViewDelete(drawing,view,1);//Delete unreasonable view
ProDrawingGeneralviewCreate(drawing, solid,sheet,0,pos,scale,matrix,&view);//Regenerate the view according to the scale of the scale
ProDwgSheetRegenerate(drawing,sheet);//Refresh the window and redisplay the generated view
Third, the display size method analysis
In Pro/ENGINEER, the size of the part mode storage and the size created in the drawing are different concepts, so there are two ways to display the size of the part.
1. Generate new dimensions in draft mode
The size generation function ProDrawingDimCreate() is provided in TOOLKIT, which can be used to generate various sizes. However, this function requires more input parameters, including drawing, Dimension Attachments, ProDimSense, Dimension Text Location, and so on.
2. Display the dimensions stored in the solid model directly in the drawing mode
The size display function ProDimensionShow() is provided in TOOLKIT, which can be used to conditionally display various sizes stored in the solid model in the drawing mode. This is also the default method for displaying the model size in the Pro/ENGINEER drawing module. In comparison, this method of displaying dimensions is simpler and more applicable, and according to the processing-oriented design idea (DFM), processing can be considered in the design stage, ie, the solid modeling stage, so that the dimensional information stored in the solid model satisfies the processing requirements. , that is, the requirements for the size display at the time of drawing are satisfied.
3. Size display examples and programs
In this example, the second size display method is selected.
ProSolid solid;
ProSolidDimensionVisit(solid,-1,(ProDimensionVisitAction)DimVisitAction01,
(ProDimensionFilterAction)DimVisitFilter01,
(ProAppData)&p_data);//traverse the various dimensions in the solid model
ProError DimVisitAction01(ProDimension *dimension,ProError status,data *p_data)
/ / size processing function
{
ProDimensionShow(dimension, p_data->p_view, p_data->p_drawing, NULL);
/ / size display
ProDrawingDimensionPosGet(p_data->p_drawing,dimension,location);
/ / Get the default label text position
ProDrawingDimensionMove(p_data->p_drawing,dimension,location_new);
/ / Move the label text to the specified location
}
ProError DimVisitFilter01(ProDimension *dimension)// size traversal filter function
{
Status = .............;
/ / Set different filter conditions, so that different types of sizes can correspond to different processing functions
Return (status);
}
Previous page next page
Hvac Filters,Hepa Air Filter,Hvac Air Filters,Hepa Media Filter
Dongguan V1 Environmental Technology Co., Ltd. , https://www.v1airpurifier.com