# Scripting component Angle (angleDegrees)

**URL:** <https://forum.inductiveautomation.com/t/scripting-component-angle-angledegrees/17140>\
**Category:** Ignition\
**Created:** [February 26, 2018, 5:20pm UTC](https://forum.inductiveautomation.com/t/scripting-component-angle-angledegrees/17140 "2018-02-26T17:20:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adampainter](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@adampainter](https://forum.inductiveautomation.com/u/adampainter)\
**Post date:** [February 26, 2018, 5:20pm UTC](https://forum.inductiveautomation.com/t/scripting-component-angle-angledegrees/17140/1 "2018-02-26T17:20:07Z")

</div>

Are there any known issues with setting a component’s angleDegrees (or angleRadians) properties? When executing the statements:

popup = system.gui.getWindow(event.source.parent.popupWindowPath)  
for param in taskParams:  
index = getIndexFromParamName(param)  
defect = popup.rootContainer.getComponent(defectName + str(index))  
defect.relX = 500  
defect.relY = 500  
angle = math.radians(360 \* index / numPoints) + angleOffset + angleAdjust  
point = polar(radius, angle)  
point[0] = point[0] - defectSize + centerX  
point[1] = point[1] - defectSize + centerY  
defect.relX = point[0]  
defect.relY = point[1]  
angle = math.degrees(angle) + 180  
defect.angleDegrees = math.degrees(angle) + 180

The last line of code setting the components angle orientation is causing the circle width and height to go to zero. When trying to reset the width / height to a new value (in designer), I’m seeing NaN returned as the component’s position, width, height. The rest of the script works as expected. The purpose of this code is to move components (circle and trianges) in a circular ring and rotate them. Rotation is critical for the triangular shapes (i.e. arrows) but not so much for circles, however want the code to work for both shapes.
