Create Custom Stroke Styles in Script

So, this is a feature I struggled with for a long time. The software allows you to select stroke styles from a canned list. Recently I was creating a graphic of a meter that had circular markings I wanted to create using a line. Well I was unable to with the canned line patterns.

Recently i learned about a script you can use to change a line stroke style.

Example (This is a on a Mouse Clicked Function):
#BasicStroke(float width, int cap, int join, float miterlimit, float dash, float dash_phase)
width = 8
cap = 0
join = 0
miter = 1
dash = [1.5,36]
phase = 0
from java.awt import BasicStroke
event.source.strokeStyle = BasicStroke(width ,cap,join,miter,dash,phase)

I have attached images showing what you can do with a line now! The after picture I am currently working on!




Final product with active display and rotating marker.


Very cool! Nice job.