Hello,
I tried to implement a similar application. However, I cannot get the ParameterRedef method to work.
Here is a snippet of my code:
myPSystem = client.get_descriptors(schema.ProductSystem) # I had to get rid of the UUID as it raised an error (2 arguments expected, 3 given)
myPSystem_par = client.get_parameters(schema.ProductSystem, "bb62617b-6bc3-46a6-b7a3-100574780b1b")
bsp_liste = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
for i in range(len(myPSystem_par)):
print(bsp_liste[i])
print(f"Parameter Name: {myPSystem_par[i].name}, Value: {myPSystem_par[i].value}, Context: {myPSystem_par[i].context}")
# myPSystem_par[i].value = float(bsp_liste[i])
schema.ParameterRedef(name=myPSystem_par[i].name, value=float(bsp_liste[i]), context=myPSystem_par[i].context)
print(f"Parameter Name: {myPSystem_par[i].name}, Value: {myPSystem_par[i].value}, Context: {myPSystem_par[i].context}")
The code should display the names and values of the parameters within the product system, then change the values and display the new values. Instead, I get the same result twice (so no redefinition is being done). I also tried to change only one value (so no for loop), but it didn’t work either.
Has anyone else encountered a similar issue and could help me out?
Thanks in advance!
Regards,
Armando