question

Shinya O avatar image
0 Likes"
Shinya O asked Shinya O commented

Walls as subnodes of planes

Hi,

I have two problems with setting walls as subnodes of planes.

  1. Even if I use Edit Selected Objects to move a wall to a subnode of a plane and set its position on reset, the wall's position shifts when I reset.
  2. If I try to place a new wall from the library after moving a wall to a subnode of a plane, the wall is created in a different location from where I clicked.

Is there a workaround?

I want to model the layouts for the first and second floors on separate planes, but I'm having trouble with the positions shifting.

It's similar to the issue pointed out in the post below.

https://answers.flexsim.com/questions/49802/walls-on-plane-bug.html

Thanks in advance.

FlexSim 24.0.4
wallssubnodeswall
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
0 Likes"
Felix Möhlmann answered Shinya O commented

The pillars you place in the model are drawsurrogates of the invisible "Walls" object. Their position is thus saved relative to the Walls object which by default is placed at the coordinate origin of the model. When you move that object into a plane, the coordinate values stay the same but are now relative to the plane. So the Walls object moves to the origin of the plane (upper left corner) and with it the pillars.

The object seems to be hardcoded to set its coordinates to (0, 0, 0) upon reset and having more than one "Walls" object in the model is also not really supposed to happen.

The best workaround I could find is this (starting from a fresh model):

- Add walls in the location you want.

- Run the code below (adjusting the name of the plane if needed, of course). This creates a copy of the "Walls" object in the plane and adjusts the position of the pillars to account for the change in location of the Walls object. In then deletes the pillars from the original walls object, so you can start building out the walls for another floor in the same object (FlexSim seems to store a reference to the Walls object and creates all pillars as surrogates of it, hence why I copy it and reset so the original. Otherwise new pillars would get added to the object in the plane if it was simply moved there).

Object walls = Model.find("Walls");
Object plane = Model.find("Plane1"); // Make copy of "Walls" object in plane and adjust position of pillars Object wallsCopy = createcopy(walls, plane, 1); Vec3 planeLoc = plane.getLocation(0, 0, 0).project(plane.up, walls.up); treenode surrogates = wallsCopy.attrs.drawsurrogate; for(int i = 1; i <= surrogates.subnodes.length; i++) {     surrogates.subnodes[i].as(Object).location -= planeLoc; } // Clear all pillars from the original walls object walls.attrs.drawsurrogate.subnodes.clear(); getvarnode(walls, "walls").subnodes.clear();

- You can still adjust the pillar locations or remove them, but adding more pillars to the same "Walls" object plane would be hard. Adding another copy to the same plane is viable though.

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

Shinya O avatar image Shinya O commented ·
Thank you very much.
0 Likes 0 ·