CompoundPathItems
CompoundPathItems
Section titled “CompoundPathItems”app.activeDocument.activeLayer.compoundPathItems
CompoundPathItem 对象的集合。
CompoundPathItems.length
Section titled “CompoundPathItems.length”app.activeDocument.activeLayer.compoundPathItems.length
集合中对象的数量。
数字;只读。
CompoundPathItems.parent
Section titled “CompoundPathItems.parent”app.activeDocument.activeLayer.compoundPathItems.parent
此集合的父对象(可以是 Layer
或 GroupItem
)。
对象;只读。
CompoundPathItems.typename
Section titled “CompoundPathItems.typename”app.activeDocument.activeLayer.compoundPathItems.typename
引用对象的类名。
字符串;只读。
CompoundPathItems.add()
Section titled “CompoundPathItems.add()”app.activeDocument.activeLayer.compoundPathItems.add()
创建一个新的 CompoundPathItem
。
CompoundPathItems.getByName()
Section titled “CompoundPathItems.getByName()”app.activeDocument.activeLayer.compoundPathItems.getByName(name)
获取集合中具有指定名称的第一个元素。
参数 | 类型 | 描述 |
---|---|---|
name | 字符串 | 要获取的元素的名称 |
CompoundPathItems.index()
Section titled “CompoundPathItems.index()”app.activeDocument.activeLayer.compoundPathItems.index(itemKey)
从集合中获取一个元素。
参数 | 类型 | 描述 |
---|---|---|
itemKey | 字符串, 数字 | 字符串或数字键 |
CompoundPathItems.removeAll()
Section titled “CompoundPathItems.removeAll()”app.activeDocument.activeLayer.compoundPathItems.removeAll()
删除此集合中的所有元素。
无。
计算复合路径的数量
Section titled “计算复合路径的数量”// 计算当前文档中图层 1 的所有复合路径项if (app.documents.length > 0) { var doc = app.activeDocument; var numCompoundPaths = doc.layers[0].compoundPathItems.length;}