I am trying to create macro that can select the components which are not used to route wire and delete it or hide it[reference image][1].[1]: https://i.stack.imgur.com/AmqfL.png
you can see in image XML.3 and CONT.3 not connected to wire. Now i want to delete both components.so I can eliminate the useless components in my ASSY . to be honesty i don't have any idea how to proceed with it.