I'm trying to model some wire for a wiring diagram and I'm trying to figure out a quick way to model striped wire in Illustrator. I can do a solid wire by making a line and then adding a secondary stroke for the outer black line and then using a solid color for the infill but I'm unsure how to make this dual color like my example (done in paint). I'd prefer to use lines because I can get them straight, as opposed to brushes, but I'm relatively a newbie. Any tips?
About the only way to do this is via patterns. Either a pattern filled shape, or a Pattern Brush.
For a pattern brush, the set up isn't too difficult....
:) The difference between @Cai's brush and mine is that Cai's ends on a solid color, mine continues the pattern to the tip. Same basic method though.
And of course, you are not obligated to only use flat tips, You can dress the end caps up as well if necessary...
Pattern brushes are probably your best bet.
Draw a single segment of your repeating pattern. That'll be used for edges (i.e. between points) and a corner piece (I've just used a solid square). You could also create start and end tiles if needed.
Drag your edge segment to the Brushes panel and choose "Pattern Brush".
Name your brush (you should be fine with the default settings) then hit "OK".
Hold alt and drag your corner segment to the squares at each end of the pattern brush (I've circled the relevant squares).
I've created three different wire brushes here, but you could just set a colorization method from the brush options and change the stroke color:
My shoddy approximation of a wiring diagram: