從舉報平台獲取文本你好,
我一直在努力解決的問題是如何得到來自平台的*東西*。 在本例中,它是“線性擬合”下方的線性擬合方程。 “屬性”和“顯示樹結構”菜單都顯示不同的文本退出框,因此我嘗試抓住它們並使用得到(平台無法識別,或者只是對象無法識別),並且獲取文本。 兩者都沒有抓住我需要的文本。 有任何想法嗎?
另一個問題是生成了 6 個報告,其中應該是 2 個,因為 summarise 在 :sex 中創建了一個唯一值列表,而這就是 for 循環迭代的次數。 報告也會針對這些值進行過濾。
Names default to here(1);
clear log();
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
summarize( gen_lst = by( dt:sex ) );
for( i = 1, i <= N Items( gen_lst ), i++,
// Create visualization, save to target
vis = eval expr( eval(
Bivariate(
Y( :weight ),
X( :height ),
Where( :sex == expr( gen_lst[i] ) )
)
) );
// Fit: Linear
vis << Fit Line( {Line Color( {255, 000, 000} )} );
// Tries to copy equation in "Linear Fit"
try( eqs_tmp1 = report(vis)["Linear Fit", TextEditBox(1)] << Get text );
try( eqs_tmp4 = report(vis)[TextEditBox(4)] << Get text );
try( print( eqs_tmp1 ) );
try( print( eqs_tmp4 ) );
);

自動化和腳本編寫基礎數據分析和建模數據探索和可視化視窗回复:從報告平台獲取文本我認為應該是
Eval(Eval Expr(...
或者,您可以使用 By:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
vis = Bivariate( Y( :weight ), X( :height ), By( :sex ) );
vis << Fit Line( {Line Color( {255, 000, 000} )} );
(vis << XPath( "//OutlineBox[text()='Linear Fit']//TextEditBox" )) << get text;
回复:從報告平台獲取文本感謝您的快速回复,Hogi!
備用代碼根據我的喜好抓取了太多文本,如屏幕截圖所示。我正在專門尋找方程式。
不過,感謝您發現我翻轉了 eval 和 eval expr! 這樣問題就徹底解決了! 我可以使用第一次或第二次 try() 來獲取我正在尋找的方程。

回复:從報告平台獲取文本在我的系統(v17.1)上:

嗯,我想知道什麼會有所不同?
回复:從報告平台獲取文本你的截圖中的括號少了,對吧?
因此,獲取文本直接通過管道傳送到 vis,並返回完整的報告。
回复:從報告平台獲取文本這裡還有一些您可以使用的選項。 我要么使用這裡的第一個選項,要么使用 XPath
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Summarize(gen_lst = by(dt:sex));
For(i = 1, i <= N Items(gen_lst), i++,
// Create visualization, save to target
vis = Eval(Eval Expr(Bivariate(Y(:weight), X(:height), Where(:sex == Expr(gen_lst[i])))));
// Fit: Linear
vis << Fit Line({Line Color({255, 000, 000})});
txt1 = Report(vis)[OutlineBox("Linear Fit"), Text Edit Box(1)] << get text; // I would use this or XPath
txt2 = Report(vis)["Linear Fit", Text Edit Box(1)] << get text;
txt3 = ((Report(vis)[OutlineBox("Linear Fit")] << Child) << child) << get text;
);