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 called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

tml3dRenderer go through a component

LS_9776545
12-Amethyst

tml3dRenderer go through a component

Hi everyone,

in my project I have a list of components that I have to make available to the customer with a simple click.

When I click a button, the whole model must become semi-transparent and ONLY the components within a list that I pass appropriately must be selectable.

I tried with the function:

tml3dRenderer.setProperties ($scope.app.cad.ModelID, {opacity: 0.10});

but that's not what I want. Semi-transparent components must NOT be selectable.

 

Thank you 

 

Esiste un modo per passare attraverso una parte? 

2 REPLIES 2

I am not sure what is the value of 

$scope.app.cad.ModelID

.But  I belive it contains the  model widget name.

Let say when we have model widget with the name model-1

if you use then as argument model-1-/ this will be applied to the whole model

You need to add here also component path - this is the same when you add a modelItem widget - Component Occurrence property

example  - if the comp Path or path id --> and the correct selection name

/1/2/15       ==>  model-1-/1/2/15

/0/0/1/3  ==> model-1-/0/0/1/3

What means  here selectable?

Ok if you want that all compoents  will be hiden or tansperent you can call the method.

e.g. modelWeidget ) model-1 with first argument =model-1/  or you will call for all components this mehode

e.g. 

model-1-/0/1

model-1-/0/2

model-1-/0/3

etc...

So let say you will make the most coponents transparent.  So far I understand your issue/ unfortunately first when I read it second time , it seems that you want only  the remaining  components which you did not made transparent should be selctable.

But what means this. The selection is done buy UI, And so far there is no way to change this behavior so far an component is visible (tranparent with value 0.1)

In this case you can try to blank the component

 

tml3dRenderer.setProperties ('model-1/-/0/7/3", {phantom:true, hidden:true});
or
tml3dRenderer.setProperties ('model-1/-/0/7/3", {phantom:true, opacity:0.5});

 

you can try , possibly set the  phantom property to  true not sure but it could  disable the abilitiy for slection (you can check)

An other approach is to use some user pick event where  you will check if the selected component is a part of list:

 

$scope.$on('$ionicView.afterEnter', function() { 

$timeout(function() { // set the userpick triger for the selection of components
  angular.forEach($element.find('twx-dt-model'), function(value, key) {
    console.log("2 forEach: key="+key.toString() +" -- value="+value); 
angular.element(value).scope().$on('userpick',function(event,target,parent,edata) {
if (edata) { // if the click was a real selection
// create the selection form modelId (model widget ) and path from edata
 $scope.currentSelection = target + '-' + JSON.parse(edata).occurrence;
//=========================================
//CHECK HERE IF YOU SELECTION IS CONTAINED BY LIST
if ( $scope.IsCurrentSelectionIsPartOfList($scope.currentSelection) == true)
//if the current selection is part of the list - then use this selection for some specific actions
// here the funciton which check if selction if it is part of the list 
//$scope.IsCurrentSelectionIsPartOfList should be defined 
//=====================================0==
}
 })    
 })},500)
////////////////////////////////////////////////////////
})

 

 

Announcements

Top Tags