<?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: List of all Platform objects? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687282#M87293</link>
    <description>&lt;P&gt;working on it :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;I hoped that somebody did this already 5 years ago and can directly provide the solution ...&lt;/P&gt;</description>
    <pubDate>Sat, 14 Oct 2023 15:13:34 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-10-14T15:13:34Z</dc:date>
    <item>
      <title>List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687209#M87280</link>
      <description>&lt;P&gt;If I generate a platform via JSL with a By variable, the return value is a list of all generated scriptable objects.&lt;/P&gt;&lt;P&gt;If I use the platform command just to open the Dialog - and then later, after the user clicked on OK, what is a fast &amp;amp; robust way to get the list of all scriptable objects which were generated?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(current report() &amp;lt;&amp;lt; xpath("//OutlineBox")) &amp;lt;&amp;lt; get scriptable object()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... with a clever preselection:&amp;nbsp; just OutlneBoxes that make sense&lt;BR /&gt;best: a universal preselection which doesn't have to be adjusted for the individual case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window("test",V List Box(
dist1=Distribution (by( :age ))), // return value: list of the scriptable objects
dist2 = Distribution(
	Continuous Distribution(Column( :height )),
	By( :age )
));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 14:31:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687209#M87280</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-14T14:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687279#M87292</link>
      <description>&lt;P&gt;I think testing out different platforms and trying to determine robust XPath would be one option.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 15:12:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687279#M87292</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-14T15:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687282#M87293</link>
      <description>&lt;P&gt;working on it :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;I hoped that somebody did this already 5 years ago and can directly provide the solution ...&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 15:13:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687282#M87293</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-14T15:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687283#M87294</link>
      <description>&lt;P&gt;Is there a "drop duplicates" for Lists of Display Boxes?&lt;BR /&gt;&lt;BR /&gt;The standard approach via&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;associative array () &amp;lt;&amp;lt; get keys&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;doesn't seem to work.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 15:16:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687283#M87294</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-14T15:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687288#M87295</link>
      <description>&lt;P&gt;If fairly sure you won't really have duplicates if you get all the outline boxes as they do refer to different objects.&lt;/P&gt;
&lt;P&gt;If you take a look at few different platforms created using By variable, you will most likely see common things&lt;/P&gt;
&lt;P&gt;Distribution:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1697297430022.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57626i587051677336A447/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1697297430022.png" alt="jthi_0-1697297430022.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Oneway:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1697297463285.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57627i45A759C514A794F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1697297463285.png" alt="jthi_1-1697297463285.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Graph Builder (a bit more rare to be created using By variable):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1697297513060.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57628i64190F13C8B83E9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1697297513060.png" alt="jthi_2-1697297513060.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You have HeadBox, ListBox and OutlineBox (in Graph Builder I think the correct display box is OwnerBox) and they have specific order. Also OutlineBox/OwnerBox have helpKey attribute.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 15:35:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687288#M87295</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-14T15:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687289#M87296</link>
      <description>&lt;P&gt;So:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(current report() &amp;lt;&amp;lt;  xpath("//OutlineBox[@helpKey]"))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 14 Oct 2023 15:42:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687289#M87296</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-14T15:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687300#M87299</link>
      <description>&lt;P&gt;I would guess that using that XPath will at least sometimes get you too many references. What I would try is to access the first level of OutlineBox which has helpKey attribute which is inside ListBox. Not sure if this will work in each of the JMP's platforms but this is hopefully a starting point&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obs = (current report() &amp;lt;&amp;lt; xpath("//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]")) &amp;lt;&amp;lt; get scriptable object();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 16:35:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687300#M87299</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-14T16:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687589#M87322</link>
      <description>&lt;P&gt;thanks, it works :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;But unfortunately, it's quite slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So perhaps it's better to get all items and then ask for the parent and for the helpKey *).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*) not working yet ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "test",
	Outline Box( "main", Life Distribution( Perspective( Compare Groups ), Y( :weight ), Grouping( :sex ), By( :age ) ) )

);

t0 = HP Time();
list1 = Current Report() &amp;lt;&amp;lt; xpath( "//OutlineBox[@helpKey]" );
Show( (HP Time() - t0) / 1000000 );

t0 = HP Time();
list2 = Current Report() &amp;lt;&amp;lt; xpath( "//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" );
Show( (HP Time() - t0) / 1000000 );

t0 = HP Time();
firstResults = Current Report() &amp;lt;&amp;lt; xpath( "//OutlineBox[@helpKey]" );
list3 = {};
For Each( {item, idx}, firstResults[{1, 2}],
	found = Regex( (item &amp;lt;&amp;lt; parent) &amp;lt;&amp;lt; get xml(), "\A.*helpKey" ); //unfortunately not restricted to first line like should be !??!?!
	If( Is Empty( item &amp;lt;&amp;lt; parent ) | Is Missing( found ),
		Insert Into( list3, item )
	);
);
Show( (HP Time() - t0) / 1000000 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(HP Time() - t0) / 1000000 = 0.048218; // no restriction&lt;BR /&gt;(HP Time() - t0) / 1000000 = 7.204071; // Xpath all-in-one&lt;BR /&gt;(HP Time() - t0) / 1000000 = 0.152291; // manual post-selection&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 12:12:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687589#M87322</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-16T12:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687699#M87327</link>
      <description>&lt;P&gt;You can most likely optimize the second XPath. Few suggestions&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//ListBox/*/OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Oct 2023 13:59:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/687699#M87327</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-16T13:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/688040#M87367</link>
      <description>&lt;P&gt;Remove Local Data Filters (with Class Name : &lt;FONT face="courier new,courier"&gt;Data Filter[]&lt;/FONT&gt; - and not &lt;FONT face="courier new,courier"&gt;"OutlineBox"&lt;/FONT&gt; :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;collectedOutlineBoxObjects = (Current Report() &amp;lt;&amp;lt; xpath( "//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" )) &amp;lt;&amp;lt; get scriptable object() ;
ListOfPlatFormObjects={};
For Each({item},collectedOutlineBoxObjects, If(item &amp;lt;&amp;lt; class name =="OutlineBox", Insert Into(ListOfPlatFormObjects, item)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 14:52:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/688040#M87367</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-17T14:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: List of all Platform objects?</title>
      <link>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/688091#M87373</link>
      <description>&lt;P&gt;You are most likely able to just use pure XPath as Data filters do have specific value as helpKey (at least based on my very quick check)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//OutlineBox[@helpKey and not(@helpKey = 'Data Filter') and not(ancestor::OutlineBox[@helpKey])]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you can maybe have just one not&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey] or @helpKey = 'Data Filter')]&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Oct 2023 16:54:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/List-of-all-Platform-objects/m-p/688091#M87373</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-17T16:54:35Z</dc:date>
    </item>
  </channel>
</rss>

