Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi, I'm new to Toolkit development, I'm using Creo Parametric 8
I'm developing a feature where to check Solid part with certain name say "X" already in an assembly if not I'm creating new part with API ProAsmcompMdlnameCreateCopy().
Problem is whenever there is part of with same name "X"(which is not assembled) in session or Current working directory it throws me an error PRO_TK_GENERAL_ERROR (-1).
I explored found API ProSessionMdlList() to get all model in session. This may be partially solves the problem.
Using loop I can avoid creating new part.
But I don't know how to check in Current working directory or any other specified location.
Please help me out.
If there is any better way for this problem, I highly appreciate it.
Thanks, in advance!
Solved! Go to Solution.
The function ProFilesList will list files in a directory. Heres a sample how I called it.
The function ProFilesList will list files in a directory. Heres a sample how I called it.
@msteffke thanks for your answer, you are right Error returned in turn a check.
extern
ProError
ProMdlnameInit ( ProMdlName name, ProMdlfileType type,ProMdl *p_mdl_handle);
Just Check for
PRO_TK_E_NOT_FOUND - Unable to find the required model.