SetActiveSegmentPair does not jumps to the segment

Hi All,

I have a Trados Studio project from a client, which contains multiple files. The plugin fails to jumps to segments under specific conditions in this project, but that happens only for that project, so with other projects it is not reproducible. I have created a minimal Trados project (based on this problematical project) and a minimal Studio project, which I can share in private. 

The problem is that, if you select multiple files in the Trados Studio project, right click and open all of them for translation (in this case one document is opened, which contains all the segments from all the documents). Then if you try to programmatically jump to a segment (eg with ID "3"), then the SetActiveSegmentPair method returns false and does nothing . Check the code below (the code is for Trados Studio 2019/2021). In this example I use the last project file, however it does not work either of the project files. If I open one file at a time (so not multiple as one), then it works. As I mentioned it also works for other projects, if i open multiple file as one.

    var editorController = SdlTradosStudio.Application.GetController<EditorController>();
    if (editorController.ActiveDocument == null) return;
    var paramFile = editorController.ActiveDocument.Files.LastOrDefault();
    // return false and nothing happens (with any file with any segment id)
    var ret = editorController.ActiveDocument.SetActiveSegmentPair(paramFile, "3", true);

Best regards,

Balazs

Parents Reply
  • Hi Andrea-Melinda,

    As I wrote, It only happens for that project, that we received from the client, for other project it works. 

    I am gladly share the project with any member of RWS, but I haven't found any email, to which i can directly send it. (Also I don't want to share in the public in general, because it is one from our client, who agreed to share it with RWS support only). I Have a minimal Trados and Visual Studio project prepared in a zip.

    Or maybe someone from RWS familiar with mentioned mentioned that much, he/she can tell under which circumstance, the SetActiveSegmentPair method returns false and does not do anything. Since it only happens at a specific project, so I assume it either some kind of bug in the API for a very specific case, or in this specific case there is some project/file general/internal level settings, which modify the behavior of this method.

Children