question

Axel Kohonen avatar image
1 Like"
Axel Kohonen asked Cole Shirley answered

Adding selected walls to group

Hi,

I had a model where I wanted to add the selected walls or actually pillars to a group so that I could easily move the group around. However, if I select the pillars and then use right click and Object groups --> Add to new group (see image below) then only the Walls object is added to the group and none of the pillars.

I was able to get around this by using the script below which loops the drawsurrogate node (containing the pillars) and adds them to the given group if the pillar is selected.

// DEFINE GROUP TO ADD TO
Group test = Group("Group1"); 

// FOR ALL SELECTED (RED) PILLAR OBJECTS IN MODEL.
// THEY EXIST UNDER THE WALLS OBJECT IN THE DRAWSURROGATE NODE
forobjecttreeunder(Model.find("Walls").find(">visual/drawsurrogate")){
    
  // IF THE PILLAR IS SELECTED
   if(switch_selected(a,-1) == 1) {

    // ADD TO GROUP
    test.addMember(a.as(Object));
  }
}

The code works nicely, but one needs to give the group manually. So it would be nicer if FlexSim would handle this automatically if pillars are selected and added to a group. Could this perhaps be added to FlexSim?

Thank you!

Kind regards,

Axel

FlexSim 18.2.2
groupwallspillar
wqivz.png (9.7 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.

1 Answer

Cole Shirley avatar image
0 Likes"
Cole Shirley answered

Closing outdated question

5 |100000

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