GraphItems
GraphItems
Section titled “GraphItems”app.activeDocument.graphItems
Description
Section titled “Description”A collection GraphItem objects, which gives you access to all the graph art items in an Illustrator document.
Properties
Section titled “Properties”GraphItems.length
Section titled “GraphItems.length”app.activeDocument.graphItems.length
Description
Section titled “Description”The number of objects in the collection.
Number; read-only.
GraphItems.parent
Section titled “GraphItems.parent”app.activeDocument.graphItems.parent
Description
Section titled “Description”The parent of this object.
Object; read-only.
GraphItems.typename
Section titled “GraphItems.typename”app.activeDocument.graphItems.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Methods
Section titled “Methods”GraphItems.getByName()
Section titled “GraphItems.getByName()”app.activeDocument.graphItems.getByName(name)
Description
Section titled “Description”Gets the first element in the collection with the specified name.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
name | String | Name of element to get |
Returns
Section titled “Returns”GraphItems.index()
Section titled “GraphItems.index()”app.activeDocument.graphItems.index(itemKey)
Description
Section titled “Description”Gets an element from the collection.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
itemKey | String, Number | String or number key |
Returns
Section titled “Returns”GraphItems.removeAll()
Section titled “GraphItems.removeAll()”app.activeDocument.graphItems.removeAll()
Description
Section titled “Description”Deletes all elements in the collection.
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Rotating graph items
Section titled “Rotating graph items”// Rotates each graph item in the current document 90 degrees.
// Verify a document with a graph item is openvar ok = false;
if (documents.length > 0) { var docRef = activeDocument; var iCount = docRef.graphItems.length; if (iCount > 0) { ok = true; for (var i = 0; i < iCount; i++) { var graphRef = docRef.graphItems[i]; graphRef.selected = true; graphRef.rotate(90); //rotate clockwise 90 degrees } redraw(); }}