Archi Forum

Archi Plug-ins => jArchi => Topic started by: TNT44 on July 22, 2023, 11:20:18 AM

Title: Diagram-model-group mask a component
Post by: TNT44 on July 22, 2023, 11:20:18 AM
Hi,

I export a view with a diagram-model-group (group) and an Application component inside.

I found the way to create a diagram-model-group and the Application component


My problem is the order of création

The diagram-model-group mask the Application component inside in the creation of the view.

Any way to correct the display ? a function ?

Thank you
Title: Re: Diagram-model-group mask a component
Post by: Jean-Baptiste Sarrodie on July 22, 2023, 21:08:47 PM
Hi,

If you want the application to be nested inside the visual group, then you have to add the application after the group or else the group will be on top. Furthermore, you have to either add the application to the view and set the optional autoNest parameter to true (https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Object#addelement), or add the application to the visual group (https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Object#addelement2).

Regards,

JB
Title: Re: Diagram-model-group mask a component
Post by: TNT44 on September 20, 2023, 20:53:35 PM
Hi Jean Baptiste ..

I understand the solution ..
I export elements to a json file ..
but, I need to know .. if an element is inside another .. and if is nested ?

for exemple an "application component" inside another "application component".
or an "diagram note" inside  an "application component".

I have the same probleme with a Visual Connections ..
Title: Re: Diagram-model-group mask a component
Post by: Phil Beauvoir on September 22, 2023, 14:08:42 PM
> I need to know .. if an element is inside another .. and if is nested?

If a visual element is nested inside of another visual element its parent is that visual element. Otherwise the parent is the diagram model:

// Get selected object
let selected = selection.first();

// Get the parent
let parent = $(selected).parent().first()

> I have the same probleme with a Visual Connections

Nesting doesn't apply to visual connections as they are on a separate layer.