<?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 CreoJS: Displaying Messages in Creo Message Log in Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048707#M14672</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We are using Creo Parametric 11.0.5.0&lt;/P&gt;&lt;P&gt;As part of our migration from Creo Weblink to CreoJS, we are using the following Weblink code to display messages in the Creo Message Log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Existing Weblink Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;function printMsg(msg){&lt;BR /&gt;var texts = pfcCreate("stringseq");&lt;BR /&gt;texts.Append(msg + "\n");&lt;BR /&gt;try {&lt;BR /&gt;var glob = pfcCreate("MpfcSession");&lt;BR /&gt;glob.GetCurrentSessionWithCompatibility(2);&lt;BR /&gt;g_session = glob.GetCurrentSession();&lt;BR /&gt;g_session.UIDisplayMessage("usermsg.txt", "USER %0s", texts);&lt;BR /&gt;} catch (e) {}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;In Creo Weblink, we used below code for pfcCreate but for CreoJS this is not needed:&lt;/P&gt;&lt;DIV&gt;function pfcCreate (className)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if (pfcIsWindows())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return new ActiveXObject ("pfc."+className);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; else if (pfcIsChrome())&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return pfcCefCreate (className);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; else if (pfcIsMozilla())&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ret = Components.classes ["@ptc.com/pfc/" + className + ";1"].createInstance();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return ret;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;I am currently facing challenges with declaring stringseq in CreoJS because I didn’t create a pfcCreate previously for CreoJS. How can I declare stringseq in CreoJS now?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide guidance on how to achieve the same functionality with CreoJS?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Dec 2025 14:54:15 GMT</pubDate>
    <dc:creator>KS_13238586</dc:creator>
    <dc:date>2025-12-22T14:54:15Z</dc:date>
    <item>
      <title>CreoJS: Displaying Messages in Creo Message Log</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048707#M14672</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;We are using Creo Parametric 11.0.5.0&lt;/P&gt;&lt;P&gt;As part of our migration from Creo Weblink to CreoJS, we are using the following Weblink code to display messages in the Creo Message Log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Existing Weblink Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;function printMsg(msg){&lt;BR /&gt;var texts = pfcCreate("stringseq");&lt;BR /&gt;texts.Append(msg + "\n");&lt;BR /&gt;try {&lt;BR /&gt;var glob = pfcCreate("MpfcSession");&lt;BR /&gt;glob.GetCurrentSessionWithCompatibility(2);&lt;BR /&gt;g_session = glob.GetCurrentSession();&lt;BR /&gt;g_session.UIDisplayMessage("usermsg.txt", "USER %0s", texts);&lt;BR /&gt;} catch (e) {}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;In Creo Weblink, we used below code for pfcCreate but for CreoJS this is not needed:&lt;/P&gt;&lt;DIV&gt;function pfcCreate (className)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if (pfcIsWindows())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return new ActiveXObject ("pfc."+className);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; else if (pfcIsChrome())&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return pfcCefCreate (className);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; else if (pfcIsMozilla())&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ret = Components.classes ["@ptc.com/pfc/" + className + ";1"].createInstance();&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; return ret;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; }&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;I am currently facing challenges with declaring stringseq in CreoJS because I didn’t create a pfcCreate previously for CreoJS. How can I declare stringseq in CreoJS now?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide guidance on how to achieve the same functionality with CreoJS?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2025 14:54:15 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048707#M14672</guid>
      <dc:creator>KS_13238586</dc:creator>
      <dc:date>2025-12-22T14:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: CreoJS: Displaying Messages in Creo Message Log</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048713#M14673</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone provide guidance on how to achieve the same functionality with CreoJS?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have found you can use this in CreoJS:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;WebLink Code
var startOfWebLinkNotice = pfcCreate("stringseq");
startOfWebLinkNotice.Set(0, "Message Text here...");
session.UIDisplayMessage("messagesFile.txt", "Message Category", startOfWebLinkNotice);

CreoJS Code
let startOfWebLinkNotice = [];// replace stringseq with this
startOfWebLinkNotice.push("Message Text here...);
session.UIDisplayMessage("messagesFile.txt", "Message Category", startOfWebLinkNotice);&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 22 Dec 2025 15:36:15 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048713#M14673</guid>
      <dc:creator>RandyJones</dc:creator>
      <dc:date>2025-12-22T15:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: CreoJS: Displaying Messages in Creo Message Log</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048714#M14674</link>
      <description>&lt;P&gt;Weblink sequences have been changed to javascript arrays in CreoJS. See page 16 of this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.ptc.com/support/-/media/support/refdocs/Creo_Parametric/12/creojsug_Creo12400.pdf?sc_lang=en" target="_blank"&gt;https://www.ptc.com/support/-/media/support/refdocs/Creo_Parametric/12/creojsug_Creo12400.pdf?sc_lang=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Convert Collections in Web.Link to Arrays in Creo.JS&lt;BR /&gt;Creo.JS changed Web.Link sequences representation to JavaScript arrays. This&lt;BR /&gt;enables use of JavaScript array construction and processing APIs.&lt;BR /&gt;The Web.Link functions that accept and return collections can be converted to use&lt;BR /&gt;arrays in Creo.JS.&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2025 15:51:48 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048714#M14674</guid>
      <dc:creator>RandyJones</dc:creator>
      <dc:date>2025-12-22T15:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: CreoJS: Displaying Messages in Creo Message Log</title>
      <link>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048723#M14675</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/381"&gt;@RandyJones&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Thanks for the Quick Reply.&amp;nbsp;&lt;BR /&gt;I missed those portion in CreoJS user guide. Also in Page 18 they have give example for Array in CreoJS. Please see the below image&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KS_13238586_0-1766422871628.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132784i237531899426F4DC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KS_13238586_0-1766422871628.png" alt="KS_13238586_0-1766422871628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Now the below code is working for me and i can be able to Display message in message log.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function printMsg(msg) {
const strTest=[];
strTest.push (msg);
try {
globalSession.UIDisplayMessage("usermsg.txt", "USER %0s", strTest);
} catch (e) {}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2025 17:01:59 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Customization/CreoJS-Displaying-Messages-in-Creo-Message-Log/m-p/1048723#M14675</guid>
      <dc:creator>KS_13238586</dc:creator>
      <dc:date>2025-12-22T17:01:59Z</dc:date>
    </item>
  </channel>
</rss>

