# How do i calculate line segment lengths within a polygon?

I have a layer with line segments and a layer of polygons (in this case, buffers around points). I need to create a new field for each polygon that contains the total length of all line segments contained within that polygon, including portions of the line segments with the polygon that straddle the borders.

-
Which version of ArcGIS are you using, and are you looking for a point and click solution or a programmatic solution? –  blah238 Feb 18 '13 at 21:01
I'm using ArcGIS 10. Either programmatic or point-and-click –  Nicholas Tulach Feb 18 '13 at 21:04

A slight modification of the answer linked in the comments would be to do a Summary Statistics to get the SUM of the Shape.Length field of the intersect feature class, using the FID field of the polygons a case field, and then Join Field that back to the polygon feature class.
intersection = arcpy.Intersect_analysis("RoadCenterline;SchoolTaxDistrict", r"in_memory\intersect")