Thanks Trae, Setting the selectionSet did it.
I was looking for this.
List<ObjectId> pid = new List<ObjectId>();
//Add ObjectIds to the pid
SelectionSet ss1 = SelectionSet.FromObjectIds(pid.ToArray());
ed.SetImpliedSelection(ss1)
This will select the respective blocks in AutoCAD.
From the comments, I gather the question was not that clear.
I add blocks to the drawing and this information and handle also go into my database.
I group blocks based on user input which also goes into my DB.
The option I had to provide to the user was if he were to run a command and select a single block belonging to a group, all the other blocks of the group were to be selected. And hence, my question.