I have a textFrame a small number of graphicObjects that are grouped together. The text frame checks to see if it is part of a group and processes each of the graphic elements.
var parent = sign.textFrame.parent;
if (parent != undefined)
// see if this sign is part of a group then grap the other graphic elements
if (parent instanceof Group)
for (var i = 0; i < parent.allPageItems.length; i++)
var graphicItem = parent.allPageItems[i];
if (graphicItem instanceof Rectangle)
var saRectangle = new SARectangle(graphicItem);
else if (graphicItem instanceof GraphicLine)
var saLine = new SALine(graphicItem);
The SARectangle function is defined as:
function SARectangle (rectangle)
this.rotation = rectangle.absoluteRotationAngle;
boundsProperty = (rectangle.visible ? 'visible' : 'geometric') + 'Bounds';
var rect = rectangle[boundsProperty];
this.upperLeft = new SAPoint(rect, rect);
this.lowerRight = new SAPoint(rect, rect);
logger.info("upperLeft (" + rect + "," + rect + ") to upperLeft (" + upperLeft.x + "," + saUpperLeft.y + ")");
logger.info("lowerRight (" + rect + "," + rect + ") to upperLeft (" + upperLeft.x + "," + saUpperLeft.y + ")");
The problem is that the geometricBounds property does not seem to be defined! When the rect variable is assigned the error 'invalid object for this request' is thrown.
Any help would be appreciated.
A second time around looking at the problem allowed me to solve the issue.
Just check to see if the geometric bounds rectagle is defined then do the processing otherwise ignore it.