question

Omar Aguilera Rico avatar image
1 Like"
Omar Aguilera Rico asked Matthew Gillespie answered

switch_hideshape does not work

I'm trying to show and hide the layout of my model using

switch_hideshape (Model.find ("Tools / ModelBackgrounds / Floor Layout"), 1);

But it's not working. How can i fix this?

FlexSim 21.1.4
flexsim 21.1.4autocad backgroundshow 3d shape
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

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

You're not actually passing in the model background. The model background isn't in the Tools folder (that's just a node that points at the background) it's in the model:

1629936498902.png

So your code should just be:

switch_hideshape (Model.find ("Floor Layout"), 1); 

Or if you wanted to turn off all the model backgrounds you could use those pointers to find them:

treenode backgrounds = Model.find("Tools/ModelBackgrounds");
for (int i = 1; i <= backgrounds.subnodes.length; i++) {
    treenode pointer = backgrounds.subnodes[i];
    treenode bg = ownerobject(pointer.value);
    switch_hideshape(bg, 1);
}

1629936498902.png (13.3 KiB)
5 |100000

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