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

Attributes for Icons

Hello everyone!


I would like to have a way to see the number of icons on an Object. 


Right now there's a work around to get the number of Icons by testing them in a loop with existsIcon, but it's impossible to get the name of the Icon that is found.


Is this something that could be expanded? Like <Path>.getIconName(IconNumber:<integer>) or similar.


Best regards

Accepted by topic author verbalins
‎10-28-2016 02:43 AM

Re: Attributes for Icons



If you change the icon to the one you want to get the name of and change it back after then the task becomes quite easy.


param IconNumber: Integer
-> String

var this: Object := self.~

var currentIcon: Integer := this.currIconNo
this.currIconNo := IconNumber
var iconName: String := this.currIcon
this.currIconNo := currentIcon
return iconName

This would be the code that I would use for the method you have suggested.



Re: Attributes for Icons

Thanks James, that works for me!

Re: Attributes for Icons

Another question though, do you know a way to query the inheritance status of the icon? I don't want to break the inheritance of the classes.

Re: Attributes for Icons



Look up the "getAttribute" method, it will return to you its value, but if you also give it a boolean variable it will change that to tell you if the attribute is inherted or not.


I cannot find a method to turn the inhertiance back on though, so guess someone else will need to help there.



Re: Attributes for Icons

Yeah, controlling inheritance is something that's not possible with code as far as I know.

Consider this scenario:
I have two instances of the class .InformationFlow.Method, called EndSim and Init. They both share the same number of icons as Method and the contents of the icons are the same as Method.

Now, when I set EndSim to display the EndSim icon and Init to display the Init icon, they get differing CurrIcon and CurrIconNo attributes when compared to Method. So they will flag as not inherited if I compare CurrIcon or CurrIconNo, but they still have the same number of icons and contents! So ideally I would like to compare the inheritance of the icon contents and not the selected icon.

But I don't think there's an attribute to ascertain the contents of the icon.