Edit in GitHubLog an issue

PathItem

一个路径或绘图对象,如一个形状的轮廓或一条直线或弧线。 它包含定义其几何形状的子路径。

通过集合中的 Document.pathItems 属性。例如,这就选择了一个命名的路径项目。

Copied to your clipboard
1const currentPathItem = app.activeDocument.pathItems.getByName("myPath");
2currentPathItem.select()

创建这些对象的方法是:通过传递一组 SubPathInfo 对象调用 PathItems.add() 方法。这个方法创建了 SubPathItem 对象,为每个 SubPathInfo 对象,并创建和返回一个新的 PathItem 对象为 所有子路径所代表的路径。

Properties

名称类型访问最低版本描述
docIdnumberR23.3这个 pathItem 的文档ID
idnumberR23.3用于批处理播放操作。这个pathItem ID和它的文档ID可以在这个文档的生命周期内用来代表这个pathItem
kindPathKindR W23.3具体的路径种类。
namestringR W23.3该路径的名称
parentDocumentR23.3该路径所在的文件。
subPathItemsSubPathItemsR23.3包含的内容 SubPathItems 在这一路径中。
typenamestringR23.3被引用对象的类名: "PathItem".

Methods

deselect

23.3

Promise<void>

取消选择这个 pathItem 对象.


duplicate

23.3

Promise<PathItem>

复制了 pathItem 对象的新名称,并返回其副本

Parameters

名称类型
name?string

fillPath

23.3

Promise<void>

填充此路径所包围的区域.

opacity 是一个百分比,在 [0.0 ... 100.0] 范围.

feather 是以像素为单位,在 [0.0 ... 250.0] 范围.

如果 wholePath 为true,在进行填充时将使用所有子路径。

Parameters

名称类型默认值
fillColor?SolidColor-
mode?ColorBlendMode-
opacitynumber100.0
preserveTransparencybooleanfalse
feathernumber0.0
wholePathbooleantrue
antiAliasbooleantrue

makeClippingPath

23.3

Promise<void>

使之成为该文件的剪切路径。

flatness 告诉PostScript打印机如何接近路径中的曲线。

Parameters

名称类型
flatness?number

makeSelection

23.3

Promise<void>

制作一个选择对象,其边界为该路径。

feather 是以像素为单位,范围为 [0.0...250.0]

operation, 默认情况下,是 SelectionType.REPLACE

Parameters

名称类型
feather?number
antiAlias?boolean
operation?SelectionType

remove

23.3

Promise<void>

删除这个对象。


select

23.3

Promise<void>

使其成为活动或选定的 PathItem 对象.


strokePath

23.3

Promise<void>

用指定的工具描边路径

tool是可选的,默认情况下将使用 ToolType.PENCIL

simulatePressure默认为false。

如果工具 ToolType.CLONESTAMPToolType.HEALINGBRUSH, sourceOrigin 必须作为 具有x和y属性(以像素为单位)的对象,用于指示笔画源的位置。source ceLayer 是可选的,默认情况下将使用文档中的活动层。

Parameters

名称类型默认值
toolToolType-
simulatePressurebooleanfalse
sourceOrigin?object-
sourceOrigin.xnumber-
sourceOrigin.ynumber-
sourceLayer?Layer-
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.