Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi, is there a simple JS method to trigger a model reload or global reset?
Many thanks
Hi @GianVal ,
for me is not quite clear what is meant with model reload or global reset. Could you provide an example when you expect these events.
Possibly you can use the event which trigger the model Load . So when you have some model widgets the event will fire for each widget when it is completely loaded its model. e.g.:
/////////////////////////
$rootScope.$on('modelLoaded', function() {
console.log("modelLoaded");
statup_y=$scope.view.wdg['model-1']['y'];
statup_scale=$scope.view.wdg['model-1']['scale'];
console.warn("statup_y="+statup_y +" || statup_scale="+statup_scale);
//////////////////////////////////////
});
I mean a global reset of eventually modified graphical properties (shadows, colors etc.)
how do you modify this graphical property. - example?
Means is this what the sequence does - modification via step etc.? There is no such mehtod , unfortunately. But you can use the events for step start and step finish or sequence event for the case that change was done by step start or finish or by setting of new sequence.
In case that the setting was done by some model property e.g. property of modelItem - this could be triggered by $watch statement when you check the property in the $watch statement if it was modified
when you have more model widgets in a view you can also check via the function arguments which modelWidget was completely loaded e.g.:
//this event fires wehen model was loaded successfuly
$rootScope.$on('modelLoaded', function() {
console.log("modelLoaded event");
const args = Array.from(arguments);
for( let i=0;i< args.length;i++ )
console.log("Event args["+i+"]="+args[i])
})
//
when you have more model widgets in a view you can also check via the function arguments which modelWidget was completely loaded e.g.:
//this event fires wehen model was loaded successfuly
$rootScope.$on('modelLoaded', function() {
console.log("modelLoaded event");
const args = Array.from(arguments);
for( let i=0;i< args.length;i++ )
console.log("Event args["+i+"]="+args[i])
})
//
i don't want to trigger events of functions on model loaded event. i want to reload the model itself during the experience.
I am sorry , this answer was sent before I could see you new message- yes you can ignorre the modelLoad points . So please see the post 01-20-2022 07:20 AM, thanks