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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How to change resource of 3D image with JS code?

Janos1987
11-Garnet

How to change resource of 3D image with JS code?

I would like to change resource of 3D image with JS code to avoid inserting all pictures. Can anyone help me?

 

Thanks

Janos 

ACCEPTED SOLUTION

Accepted Solutions

Just set the "src" property of the 3D image widget to the graphic you want. You'll need to include the relative path, usually "app/resources/Uploaded/{image filename}". Here's an example:

 

$scope.changePic = function() {
//use this form for the stock images //$scope.setWidgetProp("3DImage-1","src","app/resources/Default/vu_seq_pause.svg");
// use this form for your own uploaded images $scope.setWidgetProp("3DImage-1","src","app/resources/Uploaded/myimage.png"); }

View solution in original post

2 REPLIES 2

Just set the "src" property of the 3D image widget to the graphic you want. You'll need to include the relative path, usually "app/resources/Uploaded/{image filename}". Here's an example:

 

$scope.changePic = function() {
//use this form for the stock images //$scope.setWidgetProp("3DImage-1","src","app/resources/Default/vu_seq_pause.svg");
// use this form for your own uploaded images $scope.setWidgetProp("3DImage-1","src","app/resources/Uploaded/myimage.png"); }

You can define the 3D image source in JS like this:

 

$scope.view.wdg["3DImage-1"]['src'] = 'app/resources/Uploaded/<image you want to set>';
Announcements
Top Tags