question

Li X avatar image
0 Likes"
Li X asked Jeanette F commented

Turn each item on the tray blue

when i use setlcolor( obj object, num red, num green, num blue ) it works;

But when I use Color ,it cannot work;

the following is the error tips;

FlexSim 19.0.0
flexsim 19.0.0change color
1614658389310.png (53.1 KiB)
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Li X, was Phill BoBo's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
CSN avatar image CSN commented ·

First,you can use the method of BoBo to test your question. If you haven't solved,you can contact our local China partner (BJCSN), We will provide you with professional FlexSim technical Q&A. contact information: [email protected];

In order to solve your problem better and faster,please upload your model file.

-1 Like -1 ·

1 Answer

·
Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

subnodes[index] returns a treenode.

The color property is a property on an Object.

You need to cast the treenode as an Object.

For example:

Object obj = object.first.subnodes[index];
obj.color = Color.blue;

or

object.first.subnodes[index].as(Object).color = Color.blue;
5 |100000

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

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.