Get parameter values and set in multiple lists

Get parameter values and set in multiple lists

tracey
Enthusiast Enthusiast
452 Views
2 Replies
Message 1 of 3

Get parameter values and set in multiple lists

tracey
Enthusiast
Enthusiast

‘I have two parameters in two subassemblies:

'Controlling values in sub assemblies

Values = Parameter("C1 Right Framework - Lower:1", "LowerDoor")

Values = Parameter("C1 Upper Framework - Upper Master:1", "UpperDoor")

'Based on the value in the sub assemblies, I want to find which list has the same value and set it.

'Get all four door variation lists

'("DoorLowerA", "0","AA","BB","CC","DD","EE","FF","II","JJ","KK","LL","OO","PP","QQ")

values = MultiValue.List("DoorLowerA")

'("DoorUpperB", "0","A","B","C","D","E","F","I","J","K","L","O","P")

values = MultiValue.List("DoorUpperB")

'("DoorLowerC", "0","GG","HH","MM","NN")

values = MultiValue.List("DoorLowerC")

'("DoorUpperD ", "0","G","H","M","N")

values = MultiValue.List("DoorUpperD")

 'Parameter "LowerDoor" and "UpperDoor" has a value - If it is found in any of these lists then the list with the value needs to be set to match the value or set it to 0.

 

 If foundVal = MultiValue.FindValue(MultiValue.List ("DoorLowerA",)) "=" Parameter("C1 Right Framework - Lower:1", "LowerDoor") AndAlso

foundVal = MultiValue.FindValue(MultiValue.List ("DoorUpperB")) "=" Parameter("C1 Upper Framework - Upper Master:1", "UpperDoor") Then

Component.IsActive("Front Panel Assembly E2E4 Both 1")= True 

 

ElseIf foundVal = MultiValue.FindValue(MultiValue.List("DoorLowerA"))"=" Parameter("C1 Right Framework - Lower:1", "LowerDoor")AndAlso

foundVal = MultiValue.FindValue(MultiValue.List("DoorUpperB"))=” Parameter("C1 Upper Framework - Upper Master:1", "UpperDoor") Then

Component.IsActive("Front Panel Assembly E6 Both 1")= True

 

ElseIf foundVal = MultiValue.FindValue(MultiValue.List("DoorLowerA")) "=" Parameter("C1 Right Framework - Lower:1", "LowerDoor")AndAlso

foundVal = MultiValue.FindValue(MultiValue.List("DoorUpperB"))=” Parameter("C1 Upper Framework - Upper Master:1", "UpperDoor")Then

Component.IsActive("Front Panel Assembly E6 Upper 1")= True 

 

ElseIf foundVal = MultiValue.FindValue(MultiValue.List("DoorLowerA")) "=” Parameter("C1 Right Framework - Lower:1", "LowerDoor")AndAlso

foundVal = MultiValue.FindValue(MultiValue.List("DoorUpperB"))=” Parameter("C1 Upper Framework - Upper Master:1", "UpperDoor")Then

Component.IsActive("Front Panel Assembly E6 Lower 1")= True  

End If 

 

'various Errors:  Argument not specified for parameter 'operatorStr' of 'Public Function FindValue(valList As System.Collections.ICollection, operatorStr As String, valA As Object, [tolerance As Double = 0.0000001]) As Object'.

 

 Clearly my syntax is wrong here.  I am not a good enough coder to adapt the various cycle through the lists and find type rules and make them work

 

Any help would be appreciated.

 

Tracey

0 Likes
453 Views
2 Replies
Replies (2)
Message 2 of 3

dgreatice
Collaborator
Collaborator

Hi,

 

did you missing comma?

 

Default :

 

foundVal = MultiValue.FindValue(MultiValue.List("d0"), "<=", 4.0)

 Editing:

foundVal = MultiValue.FindValue(MultiValue.List("DoorLowerA"), "=", Parameter("C1 Right Framework - Lower:1", "LowerDoor") 

 

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
Message 3 of 3

tracey
Enthusiast
Enthusiast

Thank you for your help.

 

I get this error for the below piece of code:

Error on Line 33 : Argument not specified for parameter 'operatorStr' of 'Public Function FindValue(valList As System.Collections.ICollection, operatorStr As String, valA As Object, [tolerance As Double = 0.0000001]) As Object'.

Error on Line 33 : Argument not specified for parameter 'valA' of 'Public Function FindValue(valList As System.Collections.ICollection, operatorStr As String, valA As Object, [tolerance As Double = 0.0000001]) As Object'.

Error on Line 33 : End of statement expected.

 

Not sure how to sort this out! 

 

If foundVal = MultiValue.FindValue(MultiValue.List ("DoorLowerA")), "=", Parameter("C1 Right Framework - Lower:1", "LowerDoor") AndAlso 

 

0 Likes