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()
沃特曼达
- 粉丝: 370
- 资源: 5
最新资源
- 自己写的一个很小的工具,用于替换文件的扩展名 文件扩展名匹配的才会被替换,如果不指定原始扩展名,将修改所有文件的扩展名为新扩展名 如果新扩展名为空,则替换后文件将没有扩展名
- nginx整合lua脚本demo
- 欧标TYPE 2桩端充电枪
- (22782460)单片机设计(详细教程MSP430.zip
- UE-ORCA.zip
- (11696858)条形码生成打印
- 个人使用资源,请勿下载使用
- (180014056)pycairo-1.21.0-cp37-cp37m-win-amd64.whl.rar
- (3268844)3G无线基本知识.pdf
- 捷米特JM-PN-EIP(Profinet转Ethernet-IP)应用案例.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈