Hi Zafar,
Thank you for taking your time to post this on the forum,
I would believe this is possible with a dynamo script, are you familiar with Dynamo?
You can try and ask on the Dynamo forum if they have any suggestions for you,
Thank again and let me know if you need me to clarify any of the above,
Best Regards,

Jacob Westergaard
Autodesk Premium Support Team
AEC Premium Support Services