Kkula
Browse Questions » Plant Engineering Software COMOS: Attribute link properties via Automation code

About User

Questions Asked: 3.6K

Answers Given: 0

0
  • Open
  • New

Plant Engineering Software COMOS: Attribute link properties via Automation code

Hi everyone!
I have a list of attributes in a query and I need to link each of their values to another attribute that has the same name but belongs to other tab. The problem is that I couldn't find a way to change the value link mode to "Full Dynamic" via script. Here is the code I have written:
 
SubAction(Query, QueryBrowser)
'--------Filter cleaning--------
Query.Filter.Clear
Query.Refresh
QueryBrowser.Refresh
msgbox("Cantidad de filas sin filtros: "&Query.RowCount)
'--------Filter Setting--------
SetFilterItem1 =Query.Filter.AddNew
FilterItem1.Column=Query.BaseQuery.Columns.Item("Object_Owner")
FilterItem1.Operator = 9
FilterItem1.Value = "Y00T00001"
Query.Filter.AddNew.FType = 1
SetFilterItem2 =Query.Filter.AddNew
FilterItem2.Column=Query.BaseQuery.Columns.Item("Object")
FilterItem2.Operator = 9
FilterItem2.Value = "Z20"
Query.Refresh
QueryBrowser.Refresh
msgbox("Query Filtrada. Cantidad de filas: "&Query.RowCount)
'-------Modifies every attribute in the filtered Query-------
Fori=1ToQuery.RowCount
IfInStr(1,Query.RowObject(i).Owner.Name,"Y00T00001") > 0Then'Checks owner
IfInStr(1,Query.RowObject(i).Name,"Z20") > 0Then'Checks name
Query.RowObject(i).CreateLinkInfo'Creates link info
Query.RowObject(i).LinkInfo.LinkType = 6'Sets link type to Own Object
Query.RowObject(i).LinkInfo.SpecName = "Z10T00002." &Query.RowObject(i).Name'Defines linked attribute
'HERE IS WHERE I NEED TO CHANGE THE LINK MODE TO “FULL DYNAMIC”
End If
End If
Next
Query.Refresh
QueryBrowser.Refresh
End Sub

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(0)