Cancel
Showing results for 
Search instead for 
Did you mean: 

How to refer to a list type attribute of an unknown object on the sketch from a method?

Experimenter
Experimenter

Dear Community!

 

I have several object on my Plant Sim sketch, which all have a list type attribute with name 'Componentfailures'.

What i would like to do is calling these lists of each objects from a  method, and fill them up with some values.

What i've already tried, is represented in the attached picture. About this situation i suspect the problem is, the attribute is a list type, not an object.

 

 

str_to_string_fail.png

Does anyone know what is the problem with this program section exactly, or does anyone know another solution for referring on each attribute one-by-one, and fill them up with the required values?

 

Thanks!

2 REPLIES

Re: How to refer to a list type attribute of an unknown object on the sketch from a method?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello Pirker,

the path to the list consists of an object path, dot and the name of the list attribute:

var str:string := ".Models.PM.SP3"
var comp_fails:list[time] := str_to_obj(str).Componentsfailures

Regards,

Peter

Re: How to refer to a list type attribute of an unknown object on the sketch from a method?

Experimenter
Experimenter

Dear Peter!

 

Thank you for your answer, actually from this point of view it looks totally obvious Smiley Happy .

 

Best regards,

pirker