question

Babar Koraishy avatar image
0 Likes"
Babar Koraishy asked Babar Koraishy commented

Applying new animation to multiple processors in a model

Hello,


I have a model with many processors (with custom graphics). I created a custom library for these objects, and it has worked well.

Now i want to add an animation to these processors. I dont want to go and replace each processor, its connections etc with a new custom object (which has the animation). Is it possible to somehow 'paste' that animation on to existing objects?


Regards

BK

FlexSim 24.0.1
animations
· 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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Babar Koraishy commented

This script should copy to the selected objects (from Processor1 in this example):

  1. Object origin=Model.find("Processor1");
  2. Object target;
  3. treenode newvisuals= color(origin).up;
  4. Array selobjects=Table.query("SELECT ARRAY_AGG(Object) FROM Objects() WHERE switch_selected(Object,-1)")[1][1];
  5. while (selobjects.length){
  6.     target=selobjects.pop();
  7.     createcopy(newvisuals,color(target).up,1,0,0,1);
  8.     rebindobjectattributes(target);
  9. }
· 3
5 |100000

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