简体中文
Home > SCH_PrimitiveGenericPort > create
SCH_PrimitiveGenericPort.create() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
创建网络端口
签名
typescript
function create(
x: number,
y: number,
value: string,
rotation?: number,
width?: number | null,
height?: number | null,
ioType?: ESCH_PrimitiveGenericPortIoType | null,
harnessType?: string | null,
strokeWidth?: number | null,
strokeStyle?: ESCH_PrimitiveGenericPortStrokeStyle | null,
strokeColor?: string | null,
fillColor?: string | null,
fontColor?: string | null,
fontFamily?: string | null,
fontSize?: number | null,
textAlign?: ESCH_PrimitiveGenericPortTextAlign | null,
): Promise<ISCH_PrimitiveGenericPort | undefined>;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
参数名
参数 | 类型 | 描述 |
|---|---|---|
x | number | 坐标 X |
y | number | 坐标 Y |
value | string | 网络名称 |
rotation | number | (可选) 旋转角度,可选 |
width | number | null | (可选) 端口宽度, |
height | number | null | (可选) 端口高度, |
ioType | (可选) 端口方向, | |
harnessType | string | null | (可选) 线束类型,为用户自定义字符串, |
strokeWidth | number | null | (可选) 线宽, |
strokeStyle | (可选) 线型, | |
strokeColor | string | null | (可选) 线颜色, |
fillColor | string | null | (可选) 填充颜色, |
fontColor | string | null | (可选) 字体颜色, |
fontFamily | string | null | (可选) 字体名称, |
fontSize | number | null | (可选) 字体大小, |
textAlign | (可选) 文本对齐方式, |
返回值
Promise<ISCH_PrimitiveGenericPort | undefined>
网络端口图元对象 cli - 画布图元创建需前端已打开对应图页;Source API 暂未提供对应 add 接口
备注
ADD since EDA v5