I have the following lines generated from coordinates with XY to Line. I would like to select and delete the lines which cross and are contained within the buildings. I need to do this to find the distance between buildings. I have tried using the select by attribute tool with no luck so far. Also due to the high number of lines Arcmap 10.3 tends to crash a lot.
Ensure the lines and polygons are in a geodatabase to improve performance.
If you want to delete the entire line just "select by location" and use intersect to select lines that intersect buildings and then delete them.
Leave for a while, come back.
If you want to just delete the part of the lines that pass through the buildings.
Use the ERASE tool it will do it in one step.
No Info license?
Add a field to the buildings name DELETE (short integer) and add the value 1 to all buildings.
Run the Identity tool (join_attributes = ALL)
Delete the lines that have the attribute DELETE = 1
Check what file format you are using.
its file format must be able to store the topological properties of the objects. From this you can query in a database console and question the spatial relationships between your objects like: cross, touch, overlap, etc. If you are using Arcmap, the ESRI .shp format does not allow this as far as I know.
A good tip is to look at topological rules of geographic objects. ArcGIS can do this using the GDB / ESRI format.