cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Error with ProDrawingFromTemplate ()

KB_9753804
12-Amethyst

Error with ProDrawingFromTemplate ()

Hello Friends, 

I am new in Creo Customization , I am struck in creating of drawing template from ProDrawingFromTemplate function , I passed all valid arguments but still it returns error of PRO_TK_E_NOT_FOUND , I need help to create drawing template , I have attached code screenshot for your reference 

4 REPLIES 4

I don't see where you are setting the value of  template name,  line 56 and 57.   The actual name of the template.   You are probably using the sample code like I did, and in the sample (and in my code)  I call UsrDrawingCreate passing the actual name.   also see that TEMPLATE_NAME is the argument for my function. 

 

another thing:   see that your template.drw actually exists, in your start model directory, and the the config.pro option start_model_dir is set to the correct place.

 

code example: 
UsrDrawingCreate("ppart_vr");
return(0);
}

 

*==================================================================*\
FUNCTION: UserDrawingCreate()
PURPOSE: Creates a drawing for the current model.
\*==================================================================*/

int UsrDrawingCreate(char TEMPLATE_NAME[40])
{
ProError err, status;

I have declared template name global which is "c_drawing" , still it giving error.

RPN
17-Peridot
17-Peridot
(To:KB_9753804)

I guess the “model” handle is invalid, try “solid_mdl” for testing in the function call to create the drawing via template, this must work if your current model is a solid.

 

Or use ProSolidMdlnameInit (ProSolidInit is depri) to init a valid solid handle. I thought a function for testing like IsSolid is available, but I’m not sure ( not at my desk😵💫).  In you case you need to extract the int type of the model on top, to feed that function and to get a valid result.

KB_9753804
12-Amethyst
(To:RPN)

Thank you , it is working , successfully created drawing template , but primary views are not created , it giving error of PRO_TK_E_General  at ProDrawingFromTemplate , If you have sample code , please share with me 

Top Tags