Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

MUs Attributes

Hi Plant Simulation community.


I'm kind of new in this software and I came across a singularity.


Inside a method, I need to generate an Attribute to a MU so I can "send" it somewhere else after the upper codelines were already executed, so I create this attribute somewhere near the end of my method, but the next time the cycle starts, it will try again to create an Attribute to that entity (see image attached), how can I get to know if the property already exists before creating it?


Any ideas on the code I should use?



Thanks for reading this!

Accepted by topic author Jerogaro
‎11-09-2016 09:20 AM

Re: MUs Attributes

you can use the method getAttrNo to check, if the attribute already exists:

if @.getAttrNo("Dest") = 0 then
-- doesn't exist, create

Steffen Bangsow
freelance simulation specialist  

Re: MUs Attributes

Thanks a lot. You always come up with the right solution