I want to create a complexe line that exists of two lines (0.25mm distance 1,2mm) with black "boxes" 5mm and placed every 20mm within these two lines.
So that I can draw this line and then automatically this line will be filled with the black boxes.
Your description sounds something like a railroad track appearance (?). You could do this with 3 separate polylines. The center polyline would be a dashed linetype, 5mm long "dash" and 15 mm space. Give that polyline a width of 1.2m.