Archi Forum

Archi Plug-ins => jArchi => Topic started by: rchevallier on November 17, 2021, 13:06:48 PM

Title: Confirmation? Not possible to modify the selection with jArchi
Post by: rchevallier on November 17, 2021, 13:06:48 PM
Hello all

Idea I have is to have a jArchi script which would select some specific elements based on some properties values  among the one in a current view. 
My understanding this is not possible (ie: change the selection with JArchi)
Or is there a way?

Thanks
Title: Re: Confirmation? Not possible to modify the selection with jArchi
Post by: Phil Beauvoir on November 17, 2021, 13:38:22 PM
This is all internal Eclipse stuff. The following is how you'd do it theoretically (assuming that a View was open, otherwise you get a Null Pointer Exception):

workbench.activeWorkbenchWindow.activePage.activeEditor.selectObjects(objects);
The problem is passing an array of objects to the active editor, as it only works with internal Archi model classes. jArchi uses proxy classes that wrap the internal model classes. I think it might be possible to get them via:

object.getEObject()
through some kind of JS introspection, but I can't remember how to do that. I think Herve did it once. See https://forum.archimatetool.com/index.php?topic=644.msg3594#msg3594
Title: Re: Confirmation? Not possible to modify the selection with jArchi
Post by: rchevallier on November 20, 2021, 17:35:51 PM
Thanks, will make a try