Picking only specific types of BIM elements can easily be achieved in an add-in.
Simply use the standard PickObjects method and specify a selection filter to allow only the type of elements required:
https://www.revitapidocs.com/2020/d552f44b-221c-0ecd-d001-41a5099b2f9f.htm
An example of implementing and using such a selection filter for walls, WallSelectionFilter, is given here:
https://thebuildingcoder.typepad.com/blog/2014/01/future-proofing-the-building-coder-samples.html