User's Guide > Drawings > Creating Drawings from Templates
Creating Drawings from Templates
 
Function Introduced:
Note:
 
The function ProDrawingFromTmpltCreate() will be deprecated in a future release. Use the function ProDrawingFromTemplateCreate() instead.
Use of drawing templates simplifies drawing creation. Such templates contain drawing views with various properties such as:
Cross section view
Simplified representation
Dimensions On or Off
Repeat regions (tables based on BOM balloons)
Use the function ProDrawingFromTemplateCreate() to create a drawing from a template and to return a structure containing any errors encountered during drawing creation. This input arguments are:
New drawing name
Name of existing template to use
Solid model to use when creating drawing
Note:
 
In the function ProDrawingFromTemplateCreate(), the object ProMdlnameShortdata supports a file name of 31 characters or less for a model.
Drawing output options that specify how you want to view drawings output. Chose any or all from the following list:
PRODWGCREATE_DISPLAY_DRAWING—display new drawing in a window
PRODWGCREATE_SHOW_ERROR_DIALOG—display the template error dialog to the user
PRODWGCREATE_WRITE_ERRORS_TO_FILE—write the errors to a disk file
The function returns an error structure if any errors occur. The error structure contains an array of errors. Each error message may have:
Error type
Name of view where error occurred
Name of drawing sheet where error occurred
Name of the invalid or missing object
If the template and/ or the model name of the drawing is an embedded model name, the function ProDrawingFromTemplateCreate() returns the error PRO_TK_INVALID_NAME.
If there are one or more errors while creating the drawing, the function returns the error PRO_TK_DWGCREATE_ERRORS.
Example 1: Drawing Creation from a Template
The sample code in the file UgDrawingFromTmpltCreate.c located at <creo_toolkit_loadpoint>/protk_appls/pt_userguide/ptu_drawing shows how to create a drawing from a template.
這是否有幫助?