I want to get GraphLinkModel for selected Group

In my diagram, user can create different groups. I want users can save the specific group as a Template in database.

For that i want to get all the nodes inside that group and those node’s links with each other inside same group only.

There may a situation where User has selected a Group which is parent and inside that there are multiple groups. Than i want to cover all children groups and all node and links inside main group.

I want to produce nodeDaraArray,linkDataArray and Image for selected group.

How can i do that ?

Have you seen the Macros sample, Graphical Macros via Auto Ungrouping ?
We should extend that sample to allow users to create new macros by selecting nodes and links and then executing a command.

In the meantime: if you already have a group, you can call Group.findSubGraphParts to collect all of the nodes and links that are inside a group. Then create a temporary new Diagram in memory (it does not have to be shown in an HTMLDivElement) and pass that in a call to your main diagram’s Diagram.copyParts. Now that temporary diagram’s model has what you asked for.