iReference : VPMReference
--------------------------
let i(Integer)
let cabinList(List)
let equipList(List)
let idx(String)
let cabinName(String)
let equipName(String)
let plmID(String)
let revision(String)
let x(String)
let y(String)
let z(String)
let csvSheet(DTSheetType)
csvSheet = CreateSheet("D:\设备批量布置.csv")
for i = 1 while i < 999
{
set idx = csvSheet.CellAsString(i, 1)
if idx == "" break
set cabinName = csvSheet.CellAsString(i, 2)
set equipName = csvSheet.CellAsString(i, 3)
set plmID = csvSheet.CellAsString(i, 4)
set revision = csvSheet.CellAsString(i, 5)
set x = csvSheet.CellAsString(i, 6)
set y = csvSheet.CellAsString(i, 7)
set z = csvSheet.CellAsString(i, 8)
if cabinList->IndexOf(cabinName, 1) <= 0
{
let cabinInstance(VPMInstance)
set cabinInstance = new("VPMReference", cabinName, iReference)
cabinList->Append(cabinName)
cabinList->Append(cabinInstance.Reference)
}
if equipList->IndexOf(equipName, 1) <= 0
{
let currentQuery(PLMQuery)
currentQuery = CreatePLMQuery("VPMReference")
currentQuery->AddCriterion("PLM_ExternalID", plmID)
currentQuery->AddCriterion("revision", revision)
let resultList(List)
resultList = currentQuery->RunQuery()
let currentResult(PLMQueryResult)
set currentResult = resultList->GetItem(1)
let equipReference(VPMReference)
set equipReference = currentResult->LoadResult()
equipList->Append(equipName)
equipList->Append(equipReference)
}
let cabin(VPMReference)
set cabin = cabinList.GetItem(cabinList->IndexOf(cabinName, 1) + 1)
let equip(VPMReference)
set equip = equipList.GetItem(equipList->IndexOf(equipName, 1) + 1)
let equipInstance(VPMInstance)
set equipInstance = new("VPMInstance", equip.Name + i, cabin, equip)
let equipPosition(Matrix)
equipPosition = equipInstance.PositionMatrix
equipPosition->Set(1, 4, x->ToReal())
equipPosition->Set(2, 4, y->ToReal())
equipPosition->Set(3, 4, z->ToReal())
equipInstance.PositionMatrix = equipPosition
}
iReference->Update()
![avatar](https://profile-avatar.csdnimg.cn/119d77cead0841e68d6dc48e25ef59c0_watermanda.jpg!1)
沃特曼达
- 粉丝: 199
- 资源: 5
最新资源
- 2222222222222222222222222222
- systemverilog的svlib资料,在原来的基础上新增两个关于字符串/int和objec按照数组注册的宏定义
- 技术方案资料技术方案资料元器件封装查询图表.zip
- 毕业答辩模板极简小清新毕业答辩模板毕业答辩模板极简小清新毕业答辩模板
- 技术方案资料技术方案资料通讯录的开发-代码-Contact0.1.zip
- 技术方案资料技术方案资料手机防盗软件的实现-代码-LostPrevent.zip
- 技术方案资料技术方案资料软件管理器的开发-代码-AppExplorer-0.4.zip
- 毕业答辩模板极简高逼格创意设计毕业答辩实用模板
- 技术方案资料技术方案资料软件管理器的开发-AppExplorer-0.1源代码.zip
- 技术方案资料技术方案资料局域网构建技术详解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)