菜单

45.建模端口类

下载

建模端口类

创建建模端口

  • 接口描述:传入设备型号id,端口名称,端口位置,端口大小,对端端口位置,对端端口大小,创建建模端口。

  • URL地址:http://ip:port /wapi/v1/ports

  • 访问方法::Post

  • 请求参数:

    Body参数

参数名 类型 示例值 必填 说明
nodeTypeId Long 26000000132296 型号id
name String 3 端口名称
x Double 31.2 端口位置
y Double 84.5
width Double 62.5 端口大小
height Double 56.5
refPointX Double 0.5 对端端口相对位置
refPointY Double 0.5
refWidth Double 62.5 对端端口大小
refHeight Double 56.5
  • 响应示例:

{

"refPointY": 0.5,

"hidden": false,

"refPointX": 0.5,

"subcomponentFields": {

"id": 1155536,

"portId": 48000000320945,

"slotId": null,

"propertyId": 28000000240137,

"value": "3",

"offsetX": 0,

"offsetY": 0,

"fontSize": 10,

"color": "#000000",

"angle": 0,

"state": false,

"bold": false,

"italic": false,

"underline": false,

"fontFamily": null,

"backgroundColor": null,

"refPort": false,

"align": false,

"justification": true

},

"nodeTypeId": 26000000132296,

"refX": 31.25375,

"refAngle": 0,

"refY": 0,

"refHeight": 56.625443373078156,

"refSubcomponentFields": {

"id": 1155537,

"portId": 48000000320945,

"slotId": null,

"propertyId": 28000000240137,

"value": null,

"offsetX": 0,

"offsetY": 0,

"fontSize": 10,

"color": "#000000",

"angle": 0,

"state": false,

"bold": null,

"italic": null,

"underline": null,

"fontFamily": null,

"backgroundColor": null,

"refPort": true,

"align": false,

"justification": true

},

"refWidth": 62.50750045776367,

"name": "3",

"x": 31.25375,

"width": 62.50750045776367,

"y": 84.93816,

"angle": 0,

"id": 48000000320945,

"anchorPointY": 0.5,

"NodeClassName": "默认端口",

"height": 56.625443373078156,

"anchorPointX": 0.5

}

修改建模端口

  • 接口描述:传入建模端口id。修改建模端口属性

  • URL地址:http://ip:port /wapi/v1/ports/{portId}

  • 访问方法::Put

  • 请求参数:

    Path

参数名 类型 示例值 必填 说明
portId Long 48000000320945 端口id

Body参数

参数名 类型 示例值 必填 说明
nodeTypeId Long 26000000132296 型号id
name String 3 端口名称
x Double 211 端口位置
y Double 71
width Double 62.5 端口大小
height Double 56.5
refPointX Double 0.5 对端端口相对位置
refPointY Double 0.5
refWidth Double 62.5 对端端口大小
refHeight Double 56.5
  • 响应示例:

{

"code": 200

}

删除建模端口

  • 接口描述:传入建模端口id。删除建模端口。

  • URL地址:http://ip:port /wapi/v1/ports/{portId}

  • 访问方法::Delete

  • 请求参数:

    Path

参数名 类型 示例值 必填 说明
portId Long 48000000320945 端口id
  • 响应示例:

{

"id": 48000000320945,

"nodeTypeId": 26000000132296,

"name": "3",

"x": 212.00882,

"y": 71.50031,

"width": 62.50750045776367,

"height": 56.625443373078156,

"angle": 0,

"refX": 31.25375,

"refY": 0,

"refWidth": 62.50750045776367,

"refHeight": 56.625443373078156,

"refAngle": 0,

"anchorPointX": 0.5,

"anchorPointY": 0.5,

"refPointX": 0.5,

"refPointY": 0.5,

"nodeClassName": null,

"relativeX": 31.253750228881835,

"relativeY": 84.93816505961723,

"hidden": false

}

根据模型获取建模端口

  • 接口描述:传入模型id,查询此模型内建模端口。

  • URL地址:http://ip:port /wapi/v1/ports/{nodeTypeId}/node_type_id

  • 访问方法::Get

  • 请求参数:

    Path

参数名 类型 示例值 必填 说明
nodeTypeId Long 26000000132296 型号id
  • 响应示例:

[

{

"id": 48000000319941,

"nodeTypeId": 26000000132296,

"name": "P1",

"x": 42.9665,

"y": 439.093,

"width": 44.94778890517245,

"height": 59.830212651215334,

"angle": 0,

"refX": 42.966526,

"refY": 357.57822,

"refWidth": 44.94778890517245,

"refHeight": 24.441154438986473,

"refAngle": 0.0,

"anchorPointX": 0.5,

"anchorPointY": 0.5,

"refPointX": 0.5,

"refPointY": 0.5,

"nodeClassName": null,

"relativeX": null,

"relativeY": null,

"hidden": false

},

{

"id": 48000000319945,

"nodeTypeId": 26000000132296,

"name": "P2",

"x": 504.464,

"y": 439.093,

"width": 44.94778890517245,

"height": 59.830212651215334,

"angle": 0,

"refX": 504.464,

"refY": 357.57822,

"refWidth": 44.94778890517245,

"refHeight": 24.441154438986473,

"refAngle": 0.0,

"anchorPointX": 0.5,

"anchorPointY": 0.5,

"refPointX": 0.5,

"refPointY": 0.5,

"nodeClassName": null,

"relativeX": null,

"relativeY": null,

"hidden": false

}

]

Shift+c复制建模端口

  • 接口描述:传入被复制的建模端口id和新建端口位置,批量拷贝创建端口,在nvisual内是shift+c复制建模端口调用的接口。

  • URL地址:http://ip:port /wapi/v1/ShiftCCopyMode

  • 访问方法::Post

  • 请求参数:

    Body

参数名 类型 示例值 必填 说明
id Long 48000000319941 端口id
positionList Array [{x: 44.94778890517246, y: 0}] 新增端口位置
  • 响应示例:

{

"code": 200,

"data": [

{

"refPointY": 0.5,

"hidden": false,

"refPointX": 0.5,

"subcomponentFields": {

"id": 1155538,

"portId": 48000000320946,

"slotId": null,

"propertyId": 28000000240137,

"value": "P1",

"offsetX": 0,

"offsetY": 0,

"fontSize": 10,

"color": "#000000",

"angle": 0,

"state": false,

"bold": false,

"italic": false,

"underline": false,

"fontFamily": null,

"backgroundColor": null,

"refPort": false,

"align": false,

"justification": true

},

"nodeTypeId": 26000000132296,

"refX": 87.914314,

"refAngle": 0,

"refY": 357.57822,

"refHeight": 24.441154438986473,

"refSubcomponentFields": {

"id": 1155539,

"portId": 48000000320946,

"slotId": null,

"propertyId": 28000000240137,

"value": null,

"offsetX": 0,

"offsetY": 0,

"fontSize": 10,

"color": "#000000",

"angle": 0,

"state": false,

"bold": false,

"italic": false,

"underline": false,

"fontFamily": null,

"backgroundColor": null,

"refPort": true,

"align": false,

"justification": true

},

"refWidth": 44.94778890517245,

"name": "P1",

"x": 87.914314,

"width": 44.94778890517245,

"y": 439.093,

"angle": 0,

"id": 48000000320946,

"anchorPointY": 0.5,

"NodeClassName": "默认端口",

"height": 59.830212651215334,

"anchorPointX": 0.5

}

]

}

Alt复制建模端口

  • 接口描述:传入被复制的建模端口id列表和新建端口位置,批量拷贝创建端口,在nvisual内是Alt复制建模端口调用的接口。

  • URL地址:http://ip:port /wapi/v1/ShiftCCopyMode

  • 访问方法::Post

  • 请求参数:

    Body

参数名 类型 示例值 必填 说明
idList Array[Long] [48000000319941] 端口id
positionList Array [{x: 44.94778890517246, y: 0}] 新增端口位置
  • 响应示例:

{

"code": 200,

"data": [

{

"refPointY": 0.5,

"hidden": false,

"refPointX": 0.5,

"subcomponentFields": {

"id": 1155540,

"portId": 48000000320947,

"slotId": null,

"propertyId": 28000000240137,

"value": "P1",

"offsetX": 0,

"offsetY": 0,

"fontSize": 10,

"color": "#000000",

"angle": 0,

"state": false,

"bold": false,

"italic": false,

"underline": false,

"fontFamily": null,

"backgroundColor": null,

"refPort": false,

"align": false,

"justification": true

},

"nodeTypeId": 26000000132296,

"refX": 158.30807,

"refAngle": 0,

"refY": 302.74802,

"refHeight": 24.441154438986473,

"refSubcomponentFields": {

"id": 1155541,

"portId": 48000000320947,

"slotId": null,

"propertyId": 28000000240137,

"value": null,

"offsetX": 0,

"offsetY": 0,

"fontSize": 10,

"color": "#000000",

"angle": 0,

"state": false,

"bold": false,

"italic": false,

"underline": false,

"fontFamily": null,

"backgroundColor": null,

"refPort": true,

"align": false,

"justification": true

},

"refWidth": 44.94778890517245,

"name": "P1",

"x": 158.30807,

"width": 44.94778890517245,

"y": 384.2628,

"angle": 0,

"id": 48000000320947,

"anchorPointY": 0.5,

"NodeClassName": "默认端口",

"height": 59.830212651215334,

"anchorPointX": 0.5

}

]

}

最近修改: 2025-02-28