Line erase

i am drawing a line with the help of mouse…now i want to del some portion of the line whenver it collide with ny object…object are moving randomly

thanks