Home > PCB_PrimitiveComponent > placeFootprintWithMouse
PCB_PrimitiveComponent.placeFootprintWithMouse() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
使用鼠标放置封装
签名
typescript
placeFootprintWithMouse(footprint: {
libraryUuid: string;
uuid: string;
} | ILIB_FootprintItem | ILIB_FootprintSearchItem, properties?: {
[key: string]: boolean | number | string | undefined;
}): Promise<boolean>;1
2
3
4
5
6
2
3
4
5
6
参数名
参数 | 类型 | 描述 |
|---|---|---|
footprint | { libraryUuid: string; uuid: string; } | ILIB_FootprintItem | ILIB_FootprintSearchItem | 关联库封装 |
properties | { [key: string]: boolean | number | string | undefined; } | (可选) 器件属性 |
返回值
Promise<boolean>
是否找到封装
备注
ADD since API v0.2.26
本接口模拟前端点击放置按钮,指定的封装将绑定到当前鼠标,并在用户后续点击时放置于画布
本接口的返回时机并不会等待用户的放置操作,一旦封装被绑定到鼠标,本接口将立即返回 true 的结果