I want to stop these lines right on the edge.
I'm using Adobe Illustrator CS6, I'm fairly new to Illustrator so please be specific.
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
One easy way to do it is this:
1) Outline the strokes. Object > Path > Outline Stroke
2) You'll then have rectangles instead of lines.
3) Use the Direct Select arrow tool, and move the two righthand points so that the align with the edge of the triangle.
The only drawback is that you can no longer alter the lines by changing the stroke size. You can easily change colors however, by simply changing the fill instead of the stroke color.
Good luck, hope this helps!
I like a short way with very precise results:
If you have these shapes:
You expand the lines Object->Expand, select all shapes Command/Control+a and use Dividecommand of Pathfinder. After that you delete the shapes you don't need to get the final result:
As AndrewH said, you should just make a clipping path of the black shape on top of the lines. Then the lines would be fully editable. Take the black shape. Copy to clipboard. Do Edit > Paste In Front.
Before doing Paste In Front, make sure that nothing is selected by checking the Layers Panel, or go to Select > Deselect. You want the black shape your are pasting to be the topmost object. The key to successful clipping is to control where the object used as the clipping mask falls in the stacking hierarchy of the Illustrator file. When you are sure everything is ready, hold down the Shift key and add the lines to the selection by dragging over the exposed ends of the lines. Everything should be selected except the bottom black shape in this example. Do Object > Clipping Path > Make. You will see the ends of the lines disappear. Also you can right-click on the clipping mask and select Isolate Selected Clipping Mask. The black shape will turn grey, and you can edit the lines or other contents of clipping mask to your hearts content. Then hit the Escape key and go back to normal editing. It might be less work and faster and more flexible to do it this way.
Just to select the both pink lines layers and putted on upper the black layer and select the both pink lines layers and go to layer>create clip masking and it will give you the final output