# Create Custom Stroke Styles in Script

**URL:** <https://forum.inductiveautomation.com/t/create-custom-stroke-styles-in-script/10868>\
**Category:** General Discussion\
**Created:** [December 3, 2015, 2:40pm UTC](https://forum.inductiveautomation.com/t/create-custom-stroke-styles-in-script/10868 "2015-12-03T14:40:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [December 3, 2015, 2:40pm UTC](https://forum.inductiveautomation.com/t/create-custom-stroke-styles-in-script/10868/1 "2015-12-03T14:40:21Z")

</div>

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!

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/eecf1e0779cd870daa03229cb3b51006af0dcbc5.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ec453e7e7e01724b9221cf9e155235ea39e4b0e8.jpg)

---

<div class="post-metadata">

**Author:** ![tebright1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tebright1/32/87405_2.png) [@tebright1](https://forum.inductiveautomation.com/u/tebright1)\
**Post date:** [December 3, 2015, 5:29pm UTC](https://forum.inductiveautomation.com/t/create-custom-stroke-styles-in-script/10868/2 "2015-12-03T17:29:38Z")

</div>

Final product with active display and rotating marker.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/610712453c65e2589ba2a97f7b4c3b24703b1b37.jpg)

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [December 3, 2015, 6:45pm UTC](https://forum.inductiveautomation.com/t/create-custom-stroke-styles-in-script/10868/3 "2015-12-03T18:45:48Z")

</div>

Very cool! Nice job.
