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

Error with ProDrawingFromTemplate ()

KB_9753804
5-Regular Member

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;

KB_9753804
5-Regular Member
(To:msteffke)

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

RPN
14-Alexandrite
14-Alexandrite
(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
5-Regular Member
(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 

Announcements