Illustrator line pattern question

Is there a way to make a pattern brush so that the width of the line can vary but not distort the pattern elements? For instance, if using a repeating dot like in the example, the line width could vary but the dots could remain perfect circles.

If you’re trying to create circles, then, yes, generally.

This shows a dashed line with a rounded cap and I have adjusted the line width using the width tool. The spacing between the circles is consistent, but based on their center points, not the distance between the circles.

Thanks, but the dots were just an example to show distortion. I need it to work on a simple pattern.

Hm, sorry, I’m not sure of how to pull that off.

You could try running a script like this, but I’m not sure if the script adds the symbol at the same size, or if it adds the symbol proportionally the size of what it replaced. Of course then you would have to create your pattern as a symbol. Even then, I don’t think it will act like you want it to.