cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

JS function failed to load pvi

Wes_Tomer
12-Amethyst

JS function failed to load pvi

Hello,

 

I am trying to use the following code to set a sequence when a model is clicked on, however the .pvi fails to load each time:

 

var seq_list =["Exhaust-filters","EXPLODE-ALL","Figure 1","Raise-Pump"];


$scope.setSequence = function(val)
{ $scope.setWidgetProp('pump', 'sequence', "app\resources\Uploaded\SV300B_High\l-Creo 3D - "+seq_list[val-1]+".pvi");
/*"app/resources/Uploaded/SV300B_High/I-Creo 3D - "+seq_list[val-1]+".pvi");*/
$scope.$applyAsync();
console.log(val-1);
};

 

For each model I have a different JS command (i.e. setSequence(1); setSequence(2); setSequence(3) etc.)

The error I am getting is "pump failed to load pvi [insert pvi here]" each time I click on a model (please see attached JPG)

 

Any insight or ideas would be really appreciated!

Thank you,

Wes

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Wes_Tomer,

 

 I know that this code what you mention should work. Therefore I think the problem is in the syntax of your path.

If I look on the picture I see that the string does not contain any path separators. So believe you have to replace the "\" by "/" ( e.g. \r is missing – on your picture -  you can also try \\ but I think / is better ) and to print it to console and to check more accurately if there is pvi file on the specified location.

View solution in original post

2 REPLIES 2

Hi @Wes_Tomer,

 

 I know that this code what you mention should work. Therefore I think the problem is in the syntax of your path.

If I look on the picture I see that the string does not contain any path separators. So believe you have to replace the "\" by "/" ( e.g. \r is missing – on your picture -  you can also try \\ but I think / is better ) and to print it to console and to check more accurately if there is pvi file on the specified location.

Hi Roland,
Yes, this solved it. Thank you!
Top Tags