Home > IPCB_PrimitiveComponent > getState_Model3D
IPCB_PrimitiveComponent.getState_Model3D() method
获取属性状态:关联库 3D 模型
签名
typescript
function getState_Model3D():
{ libraryUuid: string; uuid: string; name?: undefined | string } | undefined;1
2
2
返回值
{ libraryUuid: string; uuid: string; name?: undefined | string } | undefined
关联库 3D 模型
示例
javascript
// 1. 放置一个测试器件
const devices = await eda.lib_Device.search('C0402');
const comp = await eda.pcb_PrimitiveComponent.create(devices[0], 1, 5000, 5000);
// 2. 读取关联的 3D 模型信息(未关联时返回 undefined)
const model3d = comp.getState_Model3D();
// 3. 清理测试器件
await eda.pcb_PrimitiveComponent.delete([comp.getState_PrimitiveId()]);
console.log('model3dName:', model3d ? model3d.name : '(未关联 3D 模型)');
console.log('model3dUuid:', model3d ? model3d.uuid : '(未关联 3D 模型)');1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12