Cancel
Showing results for 
Search instead for 
Did you mean: 

Created here in simtalk

Legend
Legend

Hello community,

 

I have a simple question :

 

Is there a way to know in simtalk if an user-defined-attribute is "Created here" in an object ?

 

print.png

 

4 REPLIES 4

Re: Created here in simtalk

Phenom
Phenom

Creating a user defined attribute by :

 

hand,

simtalk,

source creation table

 

all get the  "created here" setting

 

Thefore I'm curious about how to create a user defined attribute without "created here" setting.

 

 

 

Re: Created here in simtalk

Legend
Legend

if a user defined attribute is created in the Class the "created here" egal false in the children

Re: Created here in simtalk

Phenom
Phenom

And therefore inherits the userdefined Attribute ( and value)

 

is   object.userdefinedAttribute.InheritValue of any help ?

 

BTW

 

What do you need the status "created here" for ?

Re: Created here in simtalk

Siemens Phenom Siemens Phenom
Siemens Phenom

You can switch off the inheritance of the value even if the attribute itself is inherited (i.e. not created here).

 

You can find out if the attribute is created in the object this way:

param obj : object, attrName : string -> boolean
return obj.Origin.getAttrNo(attrName) = 0

In case that you call the Method for a class, you should also check for Origin=void.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.