question

yoni A avatar image
0 Likes"
yoni A asked Joshua S commented

changing color to part not pallet

change-part-color.fsm

how can I change the color of the part once it is processed and not the color of the container, see model atatched

FlexSim 18.1.2
processor
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joshua S commented

The item is a container. A container contains other objects. They are items in subnodes themselves. If you want to change an attribute of a subnode object you need a reference or pointer to them. You can use the property subnodes to get the reference. Then you want to change an attribute of an object. "subnodes" belongs to the treenode class and isn't an object. You cast the treenode to an object and then you can assign a color out of the Color class to the attribute color.

item.subnodes[1].as(Object).color = Color.blue;

The number is in the square brackets the rank of the subnode item in the container. The property "length" can you use to get the content of the container.

int contentOfItem = item.subnodes.length;
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

yoni A avatar image yoni A commented ·

thanks @Jörg Vogel, but where do I go to add that code, I got lost on your explanation. and example would be appreciated.

thanks

0 Likes 0 ·
Joshua S avatar image Joshua S yoni A commented ·
1 Like 1 ·
pic1.png (37.4 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.