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.

Joerg Vogel avatar image Joerg Vogel commented ·

@Babar Koraishy, try it with tool called edit selected object.

0 Likes 0 ·

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):

Object origin=Model.find("Processor1");
Object target;
treenode newvisuals= color(origin).up;
Array selobjects=Table.query("SELECT ARRAY_AGG(Object) FROM Objects() WHERE switch_selected(Object,-1)")[1][1];
while (selobjects.length){
    target=selobjects.pop();
    createcopy(newvisuals,color(target).up,1,0,0,1);
    rebindobjectattributes(target);
}
· 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.

Arun Kr avatar image Arun Kr commented ·
Will this script copy surrogates also?
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Arun Kr commented ·
No - thanks for pointing that out - I'll update it.
0 Likes 0 ·
Babar Koraishy avatar image Babar Koraishy commented ·

Thanks, the script worked really well, appreciate your help

0 Likes 0 ·