<?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 Re: How to call a macro in the middle of a program? in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617124#M8568</link>
    <description>&lt;P&gt;I add "Sleep(5000)" after&amp;nbsp;ProToolkitTaskExecute, but execute macro after finished code.&lt;/P&gt;
&lt;PRE&gt;status = ProToolkitTaskExecute(real,"A",input_arguments,&amp;amp;output_arguments,&amp;amp;function_return);
	Sleep(5000);&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Jul 2019 08:38:58 GMT</pubDate>
    <dc:creator>CHASEONHO</dc:creator>
    <dc:date>2019-07-09T08:38:58Z</dc:date>
    <item>
      <title>How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617068#M8557</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For synchronous toolkits, the macro is executed after the program function returns and a handle is returned to the creo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there no way to use macros in the middle of a program in a synchronous toolkit?&lt;BR /&gt;Can you tell me if there is a way to use a macro in the middle of a program in a synchronous toolkit and run the handle back to the toolkit?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since we did not find an API to extract the piping BOM, we need to extract the piping BOM using a macro.&lt;BR /&gt;For each model, you must extract all piping BOMs for each simplified representation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know how to throw a macro in the middle of code in a synchronous toolkit and get back to the toolkit, Please let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;SeonHo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. attached photo was show what i need[ PIPING BOM]&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image_1.jpg" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/17613iA2E00C0DBBD686C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image_1.jpg" alt="image_1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 01:03:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617068#M8557</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T01:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617076#M8558</link>
      <description>&lt;P&gt;There is no direct way to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found following work around:&lt;/P&gt;
&lt;P&gt;Create separate toolkit DLL application which has macro execute code.&lt;/P&gt;
&lt;P&gt;When you want to execute macro than load dll and call the required DLL methods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is like calling another application from your current application so that macro executes in sync.&lt;/P&gt;
&lt;P&gt;API's which can help you are:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ProToolkitTaskExecute&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;•ProToolkitDllLoad()&lt;BR /&gt;•ProToolkitTaskExecute()&lt;BR /&gt;•ProToolkitDllUnload()&lt;BR /&gt;•ProToolkitDllIdGet()&lt;BR /&gt;•ProToolkitDllHandleGet()&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 04:10:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617076#M8558</guid>
      <dc:creator>syalagudri</dc:creator>
      <dc:date>2019-07-09T04:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617099#M8559</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;BR /&gt;But is not this about the interaction between J-Link and the C-Toolkit?&lt;BR /&gt;I have tested and return PRO_TK_E_NOT_FOUND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS excute.c call other dll function.&amp;nbsp; basefunction.c has PRO_DLL_EXPORT function.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 06:48:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617099#M8559</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T06:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617102#M8560</link>
      <description>&lt;P&gt;You are able to load "TASKTEST.dll" in Creo ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;after your method executes .. you can see the application&amp;nbsp; TEMPDLL in Auxiliary application. you should click on in and try to start. if you get any error in starting then you have some issue with DLL. May be the way its built.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 06:57:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617102#M8560</guid>
      <dc:creator>syalagudri</dc:creator>
      <dc:date>2019-07-09T06:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617103#M8561</link>
      <description>&lt;P&gt;Yes, I can load TASKTEST.dll in CREO.&lt;/P&gt;
&lt;P&gt;If define function to menu in BASE_FUNCTOIN.c that function is work well.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 07:04:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617103#M8561</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T07:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617104#M8562</link>
      <description>&lt;P&gt;What is the error you are facing now ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is function from DLL executing ?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 07:06:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617104#M8562</guid>
      <dc:creator>syalagudri</dc:creator>
      <dc:date>2019-07-09T07:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617106#M8563</link>
      <description>&lt;P&gt;ProToolkitTaskExecute was return -4(PRO_TK_E_NOT_FOUND)&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 07:09:36 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617106#M8563</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T07:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617108#M8564</link>
      <description>&lt;P&gt;This error is may be because of name mangling&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use following macro to export method and try once.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;#define&lt;/FONT&gt; &lt;FONT color="#6f008a" face="Consolas" size="2"&gt;EXPORT&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;extern&lt;/FONT&gt; &lt;FONT color="#a31515" face="Consolas" size="2"&gt;"C"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;__declspec&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;dllexport&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 07:15:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617108#M8564</guid>
      <dc:creator>syalagudri</dc:creator>
      <dc:date>2019-07-09T07:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617109#M8565</link>
      <description>&lt;P&gt;Sorry, it works!&lt;/P&gt;
&lt;P&gt;Thanks a lot!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is MAGIC LINE!!!!!!!!!!!!!&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2" color="#808080"&gt;#define&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Consolas" size="2" color="#6f008a"&gt;EXPORT&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;extern&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Consolas" size="2" color="#a31515"&gt;"C"&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;__declspec&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;FONT face="Consolas" size="2" color="#0000ff"&gt;dllexport&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 07:45:29 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617109#M8565</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T07:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617120#M8566</link>
      <description>&lt;P&gt;Uhm... it works... but..&lt;/P&gt;
&lt;P&gt;The macro does not run in the middle of the code.&lt;BR /&gt;The macro will run after all programs have finished.&lt;BR /&gt;regret...&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:23:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617120#M8566</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T08:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617121#M8567</link>
      <description>&lt;P&gt;It worked me when I called from Jlink code. IT should work for C code also. Try adding sleep after function call.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:27:35 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617121#M8567</guid>
      <dc:creator>syalagudri</dc:creator>
      <dc:date>2019-07-09T08:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617124#M8568</link>
      <description>&lt;P&gt;I add "Sleep(5000)" after&amp;nbsp;ProToolkitTaskExecute, but execute macro after finished code.&lt;/P&gt;
&lt;PRE&gt;status = ProToolkitTaskExecute(real,"A",input_arguments,&amp;amp;output_arguments,&amp;amp;function_return);
	Sleep(5000);&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:38:58 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617124#M8568</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T08:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617127#M8569</link>
      <description>&lt;P&gt;When I was facing same issue in Jlink then I used this workaround of calling macro code from DLL and it worked for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have sometime than why don't you try same thing ?&lt;/P&gt;
&lt;P&gt;Create Jlink application. On button click you load&amp;nbsp;DLL and call macro method.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:44:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617127#M8569</guid>
      <dc:creator>syalagudri</dc:creator>
      <dc:date>2019-07-09T08:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617128#M8570</link>
      <description>&lt;P&gt;I can not handle Java.&lt;BR /&gt;So if you have to create an application for JLink to solve this problem, it will take a long time.&lt;BR /&gt;After all, C TOOLKIT can not run macros in the middle of code.&lt;BR /&gt;I had to search for another way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:48:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617128#M8570</guid>
      <dc:creator>CHASEONHO</dc:creator>
      <dc:date>2019-07-09T08:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro in the middle of a program?</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617214#M8571</link>
      <description>&lt;P&gt;At the end of the mapkey call the button command again and manage your reentry by a static var or configure the button command.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 19:58:43 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/How-to-call-a-macro-in-the-middle-of-a-program/m-p/617214#M8571</guid>
      <dc:creator>RPN</dc:creator>
      <dc:date>2019-07-09T19:58:43Z</dc:date>
    </item>
  </channel>
</rss>

