Dear Helena,
Thank you for your query.
You need to use a filtered element collector to programmatically retrieve Revit database elements.
If you are unclear about what that is, please refer to the Revit API getting started material:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#2
To determine how to identify the elements you are after, please install RevitLookup and use that to explore your Revit database:
https://github.com/jeremytammik/RevitLookup
That will provide you with a user interface that uses the Revit API to show you how they can be programmatically retrieved and explored.
For some more detailed background information specifically on line styles, please refer to The Building Coder discussion on creating a new line style:
http://thebuildingcoder.typepad.com/blog/2016/10/how-to-create-a-new-line-style.html#6
The code demonstrating that is part of The Building Coder samples:
https://github.com/jeremytammik/the_building_coder_samples
I hope this helps.
Best regards,
Jeremy