跳转到内容

CompoundPathItems

app.activeDocument.activeLayer.compoundPathItems

CompoundPathItem 对象的集合。


app.activeDocument.activeLayer.compoundPathItems.length

集合中对象的数量。

数字;只读。


app.activeDocument.activeLayer.compoundPathItems.parent

此集合的父对象(可以是 LayerGroupItem)。

对象;只读。


app.activeDocument.activeLayer.compoundPathItems.typename

引用对象的类名。

字符串;只读。


app.activeDocument.activeLayer.compoundPathItems.add()

创建一个新的 CompoundPathItem

CompoundPathItem


app.activeDocument.activeLayer.compoundPathItems.getByName(name)

获取集合中具有指定名称的第一个元素。

参数类型描述
name字符串要获取的元素的名称

CompoundPathItem


app.activeDocument.activeLayer.compoundPathItems.index(itemKey)

从集合中获取一个元素。

参数类型描述
itemKey字符串, 数字字符串或数字键

CompoundPathItem


app.activeDocument.activeLayer.compoundPathItems.removeAll()

删除此集合中的所有元素。

无。


// 计算当前文档中图层 1 的所有复合路径项
if (app.documents.length > 0) {
var doc = app.activeDocument;
var numCompoundPaths = doc.layers[0].compoundPathItems.length;
}