Filter Family Elements by Structural Usage

You may want to have a look at the following post which should answer what you want.