Your link gave me an idea to approach the problem.
But the solution in the COS used ddGetObj() function which cannot traverse to the instances of a cell.
So i used dbOpenCellVeiwByType() to get instances but its not effective could not complete the program.
Could you suggest me a function which can traverse through libname~>cellname~>instances for a given libname and cellname.
(dont tell me geEditCellView())
If i can get that then my script is done.