question

Tomi Kosunen avatar image
0 Likes"
Tomi Kosunen asked Tomi Kosunen commented

Hide wall?

Hi. Is it possible to hide a single wall segment? I'd like to hide walls on a selected floor in the building. I can hide other objects (Queue etc) by "switch_hideshape" command but it's not working for the wall segments

FlexSim 21.1.0
flexsim 21.1.0
5 |100000

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

Lars Jacobsen avatar image
0 Likes"
Lars Jacobsen answered Joerg Vogel edited

No, it is not possible. Walls are a unique object that stores and draws walls via code. It isn't a set of regular objects with regular sizes and positions. An option is to move the pillars using code.

· 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.

Tomi Kosunen avatar image Tomi Kosunen commented ·

One more question: The Wall segments are not following, while the Pillars are moved (only the Pillars are moved). I suppose, the locations/view must be updated somehow. What is the command?

treenode walls = Model.find("Walls").find(">visual/drawsurrogate");

for (int i = 1; i<=walls.subnodes.length; i++){

treenode theWall = walls.subnodes[i];

Object theWallObj = theWall.as(Object);

theWallObj.location.z = theWallObj.location.z - 10;

}



0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Tomi Kosunen commented ·

The comment as a new question is here

0 Likes 0 ·
martin.j avatar image
0 Likes"
martin.j answered Tomi Kosunen commented

Hi Tommi,

The Wall object has an internal function used to update all its walls called "setWallsDirty". This can be used to force-update the information in the wall object such as locations of the pillars, their height and by extention the height of the walls between them, ect...

Object wall = model().find("Walls");  function_s(wall, "setWallsDirty");

This funtion is called by the user interface whenever you use the quickproperties menu to make changes to walls, but just be aware that it is not actually meant to be used during model runtime, so I can't guaratee what will happen if you call it repeatedly.

If you for instance change the position or height of one of the Pillar objects in the drawsurogate of the Walls object, as you point out the drawn walls will not follow, until you call this function. Be aware that if you change the height of a pillar to 0 all walls attached to the pillar will vanish. If you want to hide all walls you could for instance move all pillars in the z-axis below the model floor and call the function.

You can also go to Walls>variable/walls node and here find a reference to all walls between the pillars. On these nodes you can set color and transparancy of a wall and the call the "setWallsDirty" function to update all your wall.

It is not a perfect solution, but it does allow you to make changes to something that was not meant to be changed at runtime.

· 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.

Tomi Kosunen avatar image Tomi Kosunen commented ·

Thanks Martin. Works perfect for me!

0 Likes 0 ·