C #을 통해 JMP 그래프 이미지 캡처를 자동화하려고합니다. 설명서에서 발견 한 바로는이를 수행하는 올바른 방법은 GetGraphicItemByName 또는 GetGraphicItemByType 및 SaveGraphicItem을 사용하여 그래프를 처리하는 것으로 나타납니다.
주제에 대한 이전 게시물에서 몇 가지 지침을 찾았습니다.
https://community.jmp.com/t5/Discussions/GetGraphicItemByName-Requires-the-where-where-the-names/td-p/20947
특히, 문서의 적절한 사용에 대한이 회신 (이 문서는 실제로 달리 부족합니다)
https://community.jmp.com/t5/Discussions/GetGraphicItemByName-Requires-the-name-where-are-the-names/mp/20950/highlight/true#M19047
하나... 내가 시도한 어떤 것도 작동하지 않는다. 모든 것이 JMP에서 원시 레벨 예외로 보이는 동일한 도움되지 않는 오류를 발생시킵니다.
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
Tree 내에서 여러 가지 다른 객체를 사용하여 ByType과 ByName 두 가지를 시도했습니다. 나는 뭔가를 놓쳐 버린 것 같은 기분이지만, 오류가 무엇이 잘못되었는지를 조금도 알려주지 않기 때문에 나는 그것이 무엇이 될 수 있는지 모른다.
JMP.Contour contour = Doc.CreateContourPlot();
contour.LaunchAddX(X1);
contour.LaunchAddX(X2);
contour.LaunchAddY(Y);
contour.FillAreas(true);
contour.ShowContours(true);
contour.Launch();
int handle = -1;
string errors = string.Empty;
for (int n = 0; n < 11; n++)
{
string name = "outline box";
switch (n)
{
case 1: name = "outlinebox"; break;
case 2: name = "Outline Box"; break;
case 3: name = "Outline box"; break;
case 4: name = "outline box"; break;
case 5: name = "framebox"; break;
case 6: name = "FrameBox"; break;
case 7: name = "Frame Box"; break;
case 8: name = "frame box"; break;
case 9: name = "Frame box"; break;
case 10: name = "Framebox"; break;
}
try
{
handle = contour.GetGraphicItemByType(name, 1);
//handle = contour.GetGraphicItemByName(name);
Console.WriteLine("Success with n = " + n);
break;
}
catch (Exception e)
{
errors += e.Message + Environment.NewLine;
}
}
if (handle == -1) throw new Exception("No handle found, errors: " + Environment.NewLine + errors);
나는이 문제를 해결했다. 오류가 내 코드의 다른 곳에서 발견되었습니다. 나는 왜 그것이 잘못했는지 확신 할 수 없다. 제가 제공 한 테이블에는 코드의 다른 버그로 인해 예상했던 컬럼이 없었습니다. 나는 JMP가 그런 간단한 오류를 잡아서 더 적절한 예외를 던져 야한다는 것을 예상했을 것이다. 그래서 나는 그 함수 자체에 문제가 있다고 생각했다.
다른 사람이 비슷한 문제로이 문제를 겪는다면 의미있는 예외를 다시보고하기 위해 JMP에 의존 할 수 없으므로 입력의 다른 측면을 모두 확인해야합니다 ...