原理图 & 符号 / 器件图元类
declare class SCH_PrimitiveComponent implements ISCH_PrimitiveAPI Implements: ISCH_PrimitiveAPI
|
Method |
Modifiers |
Description |
|---|---|---|
|
create(component, x, y, subPartName, rotation, mirror, addIntoBom, addIntoPcb) |
(BETA) 创建器件 | |
|
(BETA) 创建网络标识 | ||
|
(BETA) 创建网络端口 | ||
|
(BETA) 创建短接标识 | ||
|
(BETA) 删除器件 | ||
|
(BETA) 获取器件 | ||
|
(BETA) 获取器件 | ||
|
(BETA) 获取所有器件 | ||
|
(BETA) 获取器件关联的所有引脚 | ||
|
(BETA) 获取所有器件的图元 ID | ||
|
(BETA) 获取所有器件的所有属性名称集合 | ||
|
(BETA) 修改器件 | ||
|
(BETA) 使用鼠标放置器件 | ||
|
(BETA) 设置在扩展 API 中 AnalogGround 网络标识关联的器件 UUID | ||
|
(BETA) 设置在扩展 API 中 Ground 网络标识关联的器件 UUID | ||
|
(BETA) 设置在扩展 API 中 Power 网络标识关联的器件 UUID | ||
|
(BETA) 设置在扩展 API 中 ProtectGround 网络标识关联的器件 UUID | ||
|
(BETA) 设置在扩展 API 中 BI 网络端口关联的器件 UUID | ||
|
(BETA) 设置在扩展 API 中 IN 网络端口关联的器件 UUID | ||
|
(BETA) 设置在扩展 API 中 OUT 网络端口关联的器件 UUID |
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
创建器件
create(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem, x: number, y: number, subPartName?: string, rotation?: number, mirror?: boolean, addIntoBom?: boolean, addIntoPcb?: boolean): Promise<ISCH_PrimitiveComponent$1 | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
|
x |
number |
坐标 X |
|
y |
number |
坐标 Y |
|
subPartName |
string |
(Optional) 子图块名称 |
|
rotation |
number |
(Optional) 旋转角度 |
|
mirror |
boolean |
(Optional) 是否镜像 |
|
addIntoBom |
boolean |
(Optional) 是否加入 BOM |
|
addIntoPcb |
boolean |
(Optional) 是否转到 PCB |
Promise<ISCH_PrimitiveComponent$1 | undefined>
器件图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
创建网络标识
createNetFlag(identification: 'Power' | 'Ground' | 'AnalogGround' | 'ProtectGround', net: string, x: number, y: number, rotation?: number, mirror?: boolean): Promise<ISCH_PrimitiveComponent$1 | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
identification |
'Power' | 'Ground' | 'AnalogGround' | 'ProtectGround' |
标识类型 |
|
net |
string |
网络名称 |
|
x |
number |
坐标 X |
|
y |
number |
坐标 Y |
|
rotation |
number |
(Optional) 旋转角度 |
|
mirror |
boolean |
(Optional) 是否镜像 |
Promise<ISCH_PrimitiveComponent$1 | undefined>
器件图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
创建网络端口
createNetPort(direction: 'IN' | 'OUT' | 'BI', net: string, x: number, y: number, rotation?: number, mirror?: boolean): Promise<ISCH_PrimitiveComponent$1 | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
direction |
'IN' | 'OUT' | 'BI' |
端口方向 |
|
net |
string |
网络名称 |
|
x |
number |
坐标 X |
|
y |
number |
坐标 Y |
|
rotation |
number |
(Optional) 旋转角度 |
|
mirror |
boolean |
(Optional) 是否镜像 |
Promise<ISCH_PrimitiveComponent$1 | undefined>
器件图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
创建短接标识
createShortCircuitFlag(x: number, y: number, rotation?: number, mirror?: boolean): Promise<ISCH_PrimitiveComponent$1 | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
x |
number |
坐标 X |
|
y |
number |
坐标 Y |
|
rotation |
number |
(Optional) 旋转角度 |
|
mirror |
boolean |
(Optional) 是否镜像 |
Promise<ISCH_PrimitiveComponent$1 | undefined>
器件图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
删除器件
delete(primitiveIds: string | ISCH_PrimitiveComponent$1 | Array<string> | Array<ISCH_PrimitiveComponent$1>): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveIds |
string | ISCH_PrimitiveComponent$1 | Array<string> | Array<ISCH_PrimitiveComponent$1> |
器件的图元 ID 或器件图元对象 |
Promise<boolean>
删除操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取器件
get(primitiveIds: string): Promise<ISCH_PrimitiveComponent$1 | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveIds |
string |
器件的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组 |
Promise<ISCH_PrimitiveComponent$1 | undefined>
器件图元对象,undefined 表示获取失败
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取器件
get(primitiveIds: Array<string>): Promise<Array<ISCH_PrimitiveComponent$1>>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveIds |
Array<string> |
器件的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组 |
Promise<Array<ISCH_PrimitiveComponent$1>>
器件图元对象,空数组表示获取失败
如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取所有器件
getAll(componentType?: ESCH_PrimitiveComponentType$1, allSchematicPages?: boolean): Promise<Array<ISCH_PrimitiveComponent$1>>;|
Parameter |
Type |
Description |
|---|---|---|
|
componentType |
(Optional) 器件类型 | |
|
allSchematicPages |
boolean |
(Optional) 是否获取所有原理图图页的器件 |
Promise<Array<ISCH_PrimitiveComponent$1>>
器件图元对象数组
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取器件关联的所有引脚
getAllPinsByPrimitiveId(primitiveId: string): Promise<Array<ISCH_PrimitiveComponentPin> | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveId |
string |
器件图元 ID |
Promise<Array<ISCH_PrimitiveComponentPin> | undefined>
器件引脚图元数组
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取所有器件的图元 ID
getAllPrimitiveId(componentType?: ESCH_PrimitiveComponentType$1, allSchematicPages?: boolean): Promise<Array<string>>;|
Parameter |
Type |
Description |
|---|---|---|
|
componentType |
(Optional) 器件类型 | |
|
allSchematicPages |
boolean |
(Optional) 是否获取所有原理图图页的器件 |
Promise<Array<string>>
器件的图元 ID 数组
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取所有器件的所有属性名称集合
getAllPropertyNames(): Promise<Array<string>>;Promise<Array<string>>
所有器件的所有属性名称集合
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
修改器件
modify(primitiveId: string | ISCH_PrimitiveComponent$1, property: {
x?: number;
y?: number;
rotation?: number;
mirror?: boolean;
addIntoBom?: boolean;
addIntoPcb?: boolean;
designator?: string | null;
name?: string | null;
uniqueId?: string | null;
manufacturer?: string | null;
manufacturerId?: string | null;
supplier?: string | null;
supplierId?: string | null;
otherProperty?: {
[key: string]: string | number | boolean;
};
}): Promise<ISCH_PrimitiveComponent$1 | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveId |
string | ISCH_PrimitiveComponent$1 |
图元 ID |
|
property |
{ x?: number; y?: number; rotation?: number; mirror?: boolean; addIntoBom?: boolean; addIntoPcb?: boolean; designator?: string | null; name?: string | null; uniqueId?: string | null; manufacturer?: string | null; manufacturerId?: string | null; supplier?: string | null; supplierId?: string | null; otherProperty?: { [key: string]: string | number | boolean; }; } |
Promise<ISCH_PrimitiveComponent$1 | undefined>
器件图元对象
仅当器件类型为 COMPONENT 时允许使用该方法进行修改
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
使用鼠标放置器件
placeComponentWithMouse(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem, subPartName?: string): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
|
subPartName |
string |
(Optional) |
Promise<boolean>
是否找到器件
本接口模拟前端点击放置按钮,指定的器件将绑定到当前鼠标,并在用户后续点击时放置于画布
本接口的返回时机并不会等待用户的放置操作,一旦器件被绑定到鼠标,本接口将立即返回 true 的结果
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 AnalogGround 网络标识关联的器件 UUID
setNetFlagComponentUuid_AnalogGround(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 Ground 网络标识关联的器件 UUID
setNetFlagComponentUuid_Ground(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 Power 网络标识关联的器件 UUID
setNetFlagComponentUuid_Power(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 ProtectGround 网络标识关联的器件 UUID
setNetFlagComponentUuid_ProtectGround(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 BI 网络端口关联的器件 UUID
setNetPortComponentUuid_BI(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 IN 网络端口关联的器件 UUID
setNetPortComponentUuid_IN(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
设置在扩展 API 中 OUT 网络端口关联的器件 UUID
setNetPortComponentUuid_OUT(component: {
libraryUuid: string;
uuid: string;
} | ILIB_DeviceItem | ILIB_DeviceSearchItem): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
component |
{ libraryUuid: string; uuid: string; } | ILIB_DeviceItem | ILIB_DeviceSearchItem |
关联库器件 |
Promise<boolean>
操作是否成功