所有平台对象的列表?如果我使用 By 变量通过 JSL 生成平台,则返回值是所有生成的可编写脚本的对象的列表。
如果我仅使用平台命令打开对话框 - 然后在用户单击“确定”后,什么是快速且可靠的方法来获取生成的所有可编写脚本的对象的列表?
就像是
(current report() << xpath("//OutlineBox")) << get scriptable object()...通过巧妙的 OutlneBoxes 预选,这是有意义的 - 通用预选,无需针对个别情况进行调整。
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 )
));自动化和脚本编写回复:所有平台对象的列表?我认为测试不同的平台并尝试确定健壮的 XPath 将是一种选择。
回复:所有平台对象的列表?正在努力:)
我希望有人在 5 年前就已经这样做了,并且可以直接提供解决方案......
回复:所有平台对象的列表?显示框列表是否有“删除重复项”功能?
标准方法通过
associative array () << get keys
似乎不起作用。
回复:所有平台对象的列表?如果相当确定,如果您获得所有轮廓框,那么您实际上不会有重复项,因为它们确实引用了不同的对象。
如果您查看使用 By 变量创建的几个不同平台,您很可能会看到共同的东西
分配:

单程:

图形生成器(使用“按变量”创建的情况比较罕见):

你有 HeadBox、ListBox 和 OutlineBox(在 Graph Builder 中,我认为正确的显示框是 OwnerBox),它们有特定的顺序。 OutlineBox/OwnerBox 也有 helpKey 属性。
回复:所有平台对象的列表?所以:
(current report() << xpath("//OutlineBox[@helpKey]"))回复:所有平台对象的列表?我猜想使用 XPath 至少有时会给您带来太多参考。 我想尝试的是访问 OutlineBox 的第一级,它具有 ListBox 内的 helpKey 属性。 不确定这是否适用于每个 JMP 平台,但希望这是一个起点
obs = (current report() << xpath("//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]")) << get scriptable object();
回复:所有平台对象的列表?谢谢,它有效:)
但不幸的是,它的速度相当慢。
因此,也许最好获取所有项目,然后询问父项和 helpKey *)。
*)尚未工作...
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() << xpath( "//OutlineBox[@helpKey]" );
Show( (HP Time() - t0) / 1000000 );
t0 = HP Time();
list2 = Current Report() << xpath( "//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" );
Show( (HP Time() - t0) / 1000000 );
t0 = HP Time();
firstResults = Current Report() << xpath( "//OutlineBox[@helpKey]" );
list3 = {};
For Each( {item, idx}, firstResults[{1, 2}],
found = Regex( (item << parent) << get xml(), "\A.*helpKey" ); //unfortunately not restricted to first line like should be !??!?!
If( Is Empty( item << parent ) | Is Missing( found ),
Insert Into( list3, item )
);
);
Show( (HP Time() - t0) / 1000000 );
(生命值时间() - t0) / 1000000 = 0.048218; // 没有限制
(生命值时间() - t0) / 1000000 = 7.204071; // Xpath 一体化
(生命值时间() - t0) / 1000000 = 0.152291; // 手动后选择
回复:所有平台对象的列表?您很可能可以优化第二个 XPath。 一些建议
//ListBox/*/OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]
或者
//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]
回复:所有平台对象的列表?删除本地数据过滤器(类名:数据过滤器[] - 并不是“大纲框” 
collectedOutlineBoxObjects = (Current Report() << xpath( "//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" )) << get scriptable object() ;
ListOfPlatFormObjects={};
For Each({item},collectedOutlineBoxObjects, If(item << class name =="OutlineBox", Insert Into(ListOfPlatFormObjects, item)));
回复:所有平台对象的列表?您很可能只能使用纯 XPath,因为数据过滤器确实具有作为 helpKey 的特定值(至少基于我的快速检查)
//OutlineBox[@helpKey and not(@helpKey = 'Data Filter') and not(ancestor::OutlineBox[@helpKey])]
你也许可以只吃一个,但不可以
//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey] or @helpKey = 'Data Filter')]