<?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 J-Link_Creo 5_external_applications in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635700#M8831</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please tell me how I can run external applications from Creo using J-Link (for example, a Windows calculator). I already created a button in the taskbar, now I want to assign it such functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 12:25:02 GMT</pubDate>
    <dc:creator>VladiSlav</dc:creator>
    <dc:date>2019-11-11T12:25:02Z</dc:date>
    <item>
      <title>J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635700#M8831</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please tell me how I can run external applications from Creo using J-Link (for example, a Windows calculator). I already created a button in the taskbar, now I want to assign it such functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 12:25:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635700#M8831</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-11-11T12:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635769#M8835</link>
      <description>&lt;P&gt;That &lt;EM&gt;should&lt;/EM&gt; be a straight up Java thing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://javaconceptoftheday.com/how-to-launch-external-applications-through-java-program/" target="_blank"&gt;https://javaconceptoftheday.com/how-to-launch-external-applications-through-java-program/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 15:35:40 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635769#M8835</guid>
      <dc:creator>DavidBigelow</dc:creator>
      <dc:date>2019-11-11T15:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635841#M8839</link>
      <description>&lt;P&gt;Thanks for the answer!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This I understood how to do, the code works.&lt;BR /&gt;But I need to open a website or application using a button from Creo. For this, I think that the created class object should be in the application session.&lt;BR /&gt;I don’t know how to add it there. If I'm on the right track at all..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 06:23:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/635841#M8839</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-11-12T06:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636027#M8842</link>
      <description>&lt;P&gt;I think this is two separate task:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) to open a website pfcWindow.Window.SetURL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Creo macros can call external application. From J-Link you can a macros&lt;/P&gt;
&lt;P&gt;pfcSession.BaseSession.&lt;WBR /&gt;RunMacro&lt;BR /&gt;wfcWSession.WSession.&lt;WBR /&gt;ExecuteMacro&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 11:09:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636027#M8842</guid>
      <dc:creator>YaroslavSin</dc:creator>
      <dc:date>2019-11-13T11:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636092#M8843</link>
      <description>&lt;P&gt;Okay, thanks)&lt;BR /&gt;I will try)&lt;BR /&gt;But I would still like to run the class, an example of which was sent by DavidBigelow.&lt;BR /&gt;I tried this:&lt;BR /&gt;Session &lt;STRONG&gt;curSession &lt;/STRONG&gt;= pfcSession.&lt;EM&gt;GetCurrentSessionWithCompatibility&lt;/EM&gt;(CreoCompatibility.&lt;EM&gt;C4Compatible&lt;/EM&gt;);&lt;BR /&gt;UICommand uiCommand = &lt;STRONG&gt;curSession&lt;/STRONG&gt;.UICreateCommand("Run_Appl", new &lt;STRONG&gt;Run&lt;/STRONG&gt;());&lt;BR /&gt;but there was a mistake.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 16:51:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636092#M8843</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-11-13T16:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636097#M8844</link>
      <description>&lt;P&gt;Many thanks to &lt;U&gt;&lt;EM&gt;David Bigelow&lt;/EM&gt;&lt;/U&gt;&amp;nbsp;&amp;nbsp;and&amp;nbsp;&lt;U&gt;&lt;EM&gt;&lt;SPAN class=""&gt;ysinitsyn&lt;/SPAN&gt;&lt;/EM&gt;&lt;/U&gt;&amp;nbsp;&amp;nbsp;for your help!&lt;/P&gt;
&lt;P&gt;I did it the way &lt;U&gt;&lt;EM&gt;David Bigelow&lt;/EM&gt;&lt;/U&gt; wrote it.&lt;/P&gt;
&lt;P&gt;It's just that the class I was calling needed to be changed a bit.&lt;BR /&gt;If anyone is interested and will be useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;class LaunchingExternalApps extends DefaultUICommandActionListener&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public LaunchingExternalApps() throws jxthrowable {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; @Override&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; public void OnCommand() throws jxthrowable&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Runtime runtime = Runtime.getRuntime(); //getting Runtime object&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String[] s = new String[] {"&amp;lt;your browser&amp;gt;", "&amp;lt;your site&amp;gt;"};&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; runtime.exec(s);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (IOException e)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 17:22:32 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636097#M8844</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-11-13T17:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636123#M8845</link>
      <description>&lt;P&gt;Hello again!&lt;BR /&gt;Please tell me how the method&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;pfcWindow.Window.SetURL&lt;/EM&gt;&lt;/STRONG&gt; works ?&lt;/P&gt;
&lt;P&gt;I wrote like this:&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Window www = (Window) pfcWindow.WindowOId_Create(0);&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;www.SetURL("&amp;lt;my site&amp;gt;");&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;But it doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 18:56:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636123#M8845</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-11-13T18:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636156#M8846</link>
      <description>&lt;P&gt;A piece of code from standard sample&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;// Code to display info file into Pro/E browser window
Window current_win = session.GetCurrentWindow ();
String line;
line = "file://";
line += session.GetCurrentDirectory();
line += InfoFile_name;
current_win.SetURL(line);&lt;/LI-CODE&gt;
&lt;P&gt;If nothing is happened and no errors, try to open browser window manually to clarify that the web page is changed to desired. Maybe, will be needed open browser by setting it size pfcWindow.Window.SetBrowserSize&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 05:06:54 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636156#M8846</guid>
      <dc:creator>YaroslavSin</dc:creator>
      <dc:date>2019-11-14T05:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636674#M8859</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;It works!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 12:43:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/636674#M8859</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2019-11-18T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649762#M9277</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;Here you say that you can use macros and run them in Creo.&lt;BR /&gt;Tell me, please, what am I doing wrong.&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;session.GetCurrentWindow().Activate();
String macro =  "~ Expand `main_dlg_cur` `DrwAssyTree` `node0:view_1 92 0 2 -1 \\\r\n" +
                "-1:View_Annotations -1 -1 0 -1 -1 -1`;\\\r\n" +
                "~ Select `main_dlg_cur` `DrwAssyTree` 1 `node0:view_1 92 0 2 -1 \\\r\n" +
                "-1:View_Annotations -1 -1 0 -1 -1 -1:note 0 68 0 24 -1 -1`;\\\r\n" +
                "~ Command `ProCmdEditDelete@PopupMenuTree`;";
session.RunMacro("macro");
((WSession)session).ExecuteMacro();
session.GetCurrentWindow().Activate();&lt;/LI-CODE&gt;
&lt;P&gt;The described macro should delete the detailed note in the drawing.&lt;BR /&gt;But at runtime, it does not.&lt;/P&gt;
&lt;P&gt;I read the documentation, and saw that there are a lot of limitations, but I have not enough experience to assess which are the case in my case.&lt;BR /&gt;Tell me, please, what is the problem?&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;Respectfully!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 09:02:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649762#M9277</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2020-02-19T09:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649809#M9280</link>
      <description>&lt;P&gt;You might think about approaching the mapkey differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assume you know the name of the note you want to delete. I am doing a "Control-F" to open the finder, selecting the type = Note, then entering in the name of the note I want to delete.&amp;nbsp; &amp;nbsp;Then move the note to the right side of the selections, ultimately pressing the delete key.&amp;nbsp; This works consistently.&amp;nbsp; Also - I would check whether or not you need the "\" at the end of each line in your code... That is typically &lt;STRONG&gt;not&lt;/STRONG&gt; required when running mapkey from code (at least in my experience).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a mapkey that deletes a note by name using the Creo find command to find, select and then ultimately delete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;~ Key `main_dlg_cur` `proe_win` 9 578 409 38141958 0 794 586 1920 1139 711080 `Ctrl+F`;
~ Command `ProCmdMdlTreeSearch` ;
~ Open `selspecdlg0` `SelOptionRadio`;
~ Close `selspecdlg0` `SelOptionRadio`;
~ Select `selspecdlg0` `SelOptionRadio` 1 `Note`;
~ Update `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList` `NOTE_1`;
~ Activate `selspecdlg0` `EvaluateBtn`;
~ Select `selspecdlg0` `ResultList` 0;
~ Select `selspecdlg0` `ResultList` -1;
~ Activate `selspecdlg0` `ApplyBtn`;
~ Activate `selspecdlg0` `CancelButton`;
~ Key `main_dlg_cur` `proe_win` 9 504 402 196608 512 794 586 1920 1139 727126 `Del`;
~ Command `ProCmdEditDelete`;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are trying to use the mouse to select things by window slection of an area on the drawing, you might have to record a trail file and hack that into your mapkey to perform the operations.&amp;nbsp; That is a more painful way to go... harder to create/debug.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option...&amp;nbsp; &amp;nbsp;Use &lt;A href="http://www.creoson.com" target="_blank" rel="noopener"&gt;CREOSON&lt;/A&gt;... to identify the notes and their locations on the drawings:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample Request to get notes from a drawing&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "sessionId": "~sessionId~",
  "command": "note",
  "function": "list",
  "data": {
    "file": "box.drw",
    "name": "*"
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would return something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "status": {
    "error": false
  },
  "data": {
    "itemlist": [
      {
        "name": "Note_2",
        "value": "Another test note",
        "encoded": false,
        "location": {
          "x": 2.5,
          "y": 4,
          "z": 0
        }
      }
    ]
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On a drawing - the Z value for the note location would always be "0".&amp;nbsp; &amp;nbsp;But that would give you the coordinate locations and then you can easily go delete the note by name after using this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
  "sessionId": "~sessionId~",
  "command": "note",
  "function": "delete",
  "data": {
    "file": "box.drw",
    "name": "Note_2"
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 13:24:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649809#M9280</guid>
      <dc:creator>DavidBigelow</dc:creator>
      <dc:date>2020-02-19T13:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649855#M9281</link>
      <description>&lt;P&gt;Excellent!&lt;BR /&gt;Thank you so much, it worked!&lt;BR /&gt;I used the first method described by you.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 14:59:57 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649855#M9281</guid>
      <dc:creator>VladiSlav</dc:creator>
      <dc:date>2020-02-19T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: J-Link_Creo 5_external_applications</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649856#M9282</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&amp;nbsp;Cool!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 15:01:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/J-Link-Creo-5-external-applications/m-p/649856#M9282</guid>
      <dc:creator>DavidBigelow</dc:creator>
      <dc:date>2020-02-19T15:01:26Z</dc:date>
    </item>
  </channel>
</rss>

