<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to check part exist already in session/ or disk using Creo Toolkit? in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934278#M12876</link>
    <description>&lt;P&gt;Hi, I'm new to Toolkit development, I'm using Creo Parametric 8&lt;BR /&gt;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&amp;nbsp;ProAsmcompMdlnameCreateCopy().&lt;BR /&gt;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&amp;nbsp;PRO_TK_GENERAL_ERROR (-1).&lt;/P&gt;&lt;P&gt;I explored found API ProSessionMdlList() to get all model in session. This may be partially solves the problem.&lt;/P&gt;&lt;P&gt;Using loop I can avoid creating new part.&lt;/P&gt;&lt;P&gt;But I don't know how to check in Current working directory or any other specified location.&lt;/P&gt;&lt;P&gt;Please help me out.&lt;BR /&gt;If there is any better way for this problem, I highly appreciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 08:58:09 GMT</pubDate>
    <dc:creator>AG_10775338</dc:creator>
    <dc:date>2024-03-04T08:58:09Z</dc:date>
    <item>
      <title>How to check part exist already in session/ or disk using Creo Toolkit?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934278#M12876</link>
      <description>&lt;P&gt;Hi, I'm new to Toolkit development, I'm using Creo Parametric 8&lt;BR /&gt;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&amp;nbsp;ProAsmcompMdlnameCreateCopy().&lt;BR /&gt;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&amp;nbsp;PRO_TK_GENERAL_ERROR (-1).&lt;/P&gt;&lt;P&gt;I explored found API ProSessionMdlList() to get all model in session. This may be partially solves the problem.&lt;/P&gt;&lt;P&gt;Using loop I can avoid creating new part.&lt;/P&gt;&lt;P&gt;But I don't know how to check in Current working directory or any other specified location.&lt;/P&gt;&lt;P&gt;Please help me out.&lt;BR /&gt;If there is any better way for this problem, I highly appreciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 08:58:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934278#M12876</guid>
      <dc:creator>AG_10775338</dc:creator>
      <dc:date>2024-03-04T08:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to check part exist already in session/ or disk using Creo Toolkit?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934489#M12887</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The function ProFilesList will list files in a directory.&amp;nbsp; Heres a sample how I called it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; err = ProArrayAlloc(0, sizeof(ProPath), 1, (ProArray*)&amp;amp;file_list);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;err = ProArrayAlloc(0, sizeof(ProPath), 1, (ProArray*)&amp;amp;dir_list);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strcpy(mystr, "*.prt,*.asm,*.lay");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProStringToWstring(w_line, mystr);&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;err = ProFilesList(wname, w_line, PRO_FILE_LIST_ALL,&amp;nbsp; &amp;amp;file_list, &amp;amp;dir_list);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Or... you could just use the fact that your're getting a -1 as a return value, that could be your existence test.&amp;nbsp; (Its not documented that's what causes a general error, but seems to be what triggers that return.&amp;nbsp; its a reach but..)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 Mar 2024 18:37:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934489#M12887</guid>
      <dc:creator>msteffke</dc:creator>
      <dc:date>2024-03-04T18:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to check part exist already in session/ or disk using Creo Toolkit?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934866#M12893</link>
      <description>&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/237903"&gt;@msteffke&lt;/a&gt;&amp;nbsp;thanks for your answer, you are right Error returned in turn a check.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 04:05:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/934866#M12893</guid>
      <dc:creator>AG_10775338</dc:creator>
      <dc:date>2024-03-06T04:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to check part exist already in session/ or disk using Creo Toolkit?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/938923#M12951</link>
      <description>&lt;P&gt;extern&lt;/P&gt;
&lt;P&gt;ProError&lt;/P&gt;
&lt;P&gt;ProMdlnameInit ( ProMdlName name, ProMdlfileType type,ProMdl *p_mdl_handle);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just Check for&lt;/P&gt;
&lt;P&gt;PRO_TK_E_NOT_FOUND - Unable to find the required model.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2024 22:52:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-check-part-exist-already-in-session-or-disk-using-Creo/m-p/938923#M12951</guid>
      <dc:creator>RPN</dc:creator>
      <dc:date>2024-03-24T22:52:41Z</dc:date>
    </item>
  </channel>
</rss>

