question

Jeff avatar image
0 Likes"
Jeff asked Jeff commented

Change imported model color of .dae file

I did a research to change my "Processor" color according to my global table STATUS from flexsim. However, I have quite a number of 'Processor' imported from different design models (.dae file) instead of build in "Fixed Resources" from FlexSim.

This is what I have figured out by changing the those 'Processors' color by clicking

1) Click on 'Processor1' (WDC_199)

2) Visuals > More Visuals

3) Customize the meshes in the selected 3D shape

4) Mesh > 'ID6'

5) Check 'Override' and select color from 'Diffuse color'
1745315502459.png

By using this model (model1.dae), now I want to integrate the color change by reading my global table as the data will be changing from time to time via process flow. Different "STATE" of the EQPID will have different colors. I have a custom code in my process flow to read my global table every 10 seconds.
1745315689779.pngI would like to get advise on how should I achieve this requirement? Your guidance would be much appreciate. Thanks in advance.

Color Change.fsm

model1.dae

FlexSim 25.0.4
color changefixed resource
1745315502459.png (194.3 KiB)
1745315689779.png (19.1 KiB)
color-change.fsm (160.1 KiB)
model1.dae (2.1 MiB)
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Jeff commented

You can change the diffuse color in the object's attribute tree (command "setsdtvalue()").

capture1.png

Though it would be simpler to make the mesh use the object and then change that.

Object myObject = ...;
myObject.color = Color(r, g, b, a);

capture1.png (18.8 KiB)
· 3
5 |100000

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

Jeff avatar image Jeff commented ·

Actually I have tried a number methods and flexscript to change the color of imported model but none of them work in imported model. Do you mind to show an example of flexscript via the process flow?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Jeff commented ·

color-change-1.fsm

Here's an example that uses the object color.

1 Like 1 ·
color-change-1.fsm (160.5 KiB)
Jeff avatar image Jeff Felix Möhlmann commented ·

Hi Felix, I have read through the file and finally understand how it works. I successfully manipulated and achieved the same output file as yours. I had been researching and trying different approaches for a few days. You are my savior. Thank you!

0 Likes 0 ·