Trying to get rotation angle of straight line with getRotation() method but it always returning 0.0
Tried this method: https://developers.google.com/apps-script/reference/slides/line#getrotation
Getting output: on line move from top or bottom always getting rotation 0.0.
function lineRotation() {
var selection = SlidesApp.getActivePresentation().getSelection();
if(selection.getPageElementRange() !== null){
var pageElements = selection.getPageElementRange().getPageElements()
// Iterate each page elements
pageElements.forEach(function(item, index) {
if(pageElements[index].getPageElementType() == 'LINE'){
var rotation = pageElements[index].asLine().getRotation();
}else{
SlidesApp.getUi().alert('Please select line.');
}
});
}else{
SlidesApp.getUi().alert('Please select elements.');
}
}
Desired output required: Line rotation in angle either it moved from top or bottom.
Update: Future scope - I want to get rotation and set rotation of line. If Line inclination < 45° ==> rotate horizontally or Line inclination > 45° ==> rotate vertically. https://prnt.sc/uervkw (line screenshot)