question

Sri_vikas K avatar image
0 Likes"
Sri_vikas K asked Jason Lightfoot commented

FluidToItem visual change

Hi Flexsim community,

I wanted to add a trigger on exit to FluidToItem. I changed the visual to BOX.3ds and changed the color to white. The Item color is changed to White and Item shape remains Circle. Is this a bug?


1694424522400.png


Thanks in Advance.

FlexSim 23.1.3
fluid
1694424522400.png (194.8 KiB)
· 1
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
0 Likes"
Joerg Vogel answered Joerg Vogel edited

There is a slight difference between both objects a circle and a box. You can compare both in the tree. The object circle is a billboard 2D object. You need to disable it by flag operation

Please refer to https://answers.flexsim.com/answers/28299/view.html

  1. item.attrs.find("/visual").subnodes.add().name="shape";
  2. item.attrs.find("/visual").subnodes.add().name="shapeindex";
  3. rebindobjectattributes(item.attrs.find("/visual"));
  4. imageindexobject(item).value = 0;
  5. shapeindex(item).value = 0;
  6. set(drawflags(item),get(drawflags(item)) &~ DRAW_FLAG_BILLBOARD_MASK);

I am not sure, if every code line is necessary. I put this in the onExit trigger of FluidToItem object as first behind header declaration.

EDIT: FluidToItem_shaped_Object.fsm

You still need a change of shape and resize involved item, too.


5 |100000

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