cancel
Showing results for 
Search instead for 
Did you mean: 

MUs Attributes

Pioneer
Pioneer

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!

2 REPLIES

Re: MUs Attributes

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

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

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net


Re: MUs Attributes

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