Is it possible to make groups dynamically with different shapes?

I need to reshape groups in different ways like L shape, T-shape ,means dynamically i have to create group, i have seen many samples in that all are keyboard short cuts like Ctrl+G. i didn’t seen any example for grouping thing dynamically. is it possible group things dynamically?

Using CommandHandler.groupSelection, which is called by the Ctrl-G key command, is creating a Group dynamically based on the selected Parts at that time.

But you can certainly create groups programmatically if you don’t want to call CommandHandler.groupSelection. You can read its documentation to see what that command does:

I don’t know what you mean by “L shape” or “T shape”. Really, if you want to ask a question that we can understand you need to either provide some code or some before-and-after screenshots.

I need to form group like below screen shot. but these things will happen while drawing cursor across nodes.

Are you asking for a tool that lets the user draw the outline of the new group? Perhaps you could use the PolygonDrawingTool, Then you would need to figure out which nodes are “inside” the drawn shape and add them to the new group. (You would need to deal with partial inclusions.)

If you do not want to use the new Shape as the background of the Group, you would have to figure out what to use instead, if anything.

Finally, you need to figure out the behaviors allowed when user move existing nodes out of or onto the group. One such approach is taken by the Planogram sample,