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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Modelitem visibility issue

ClayHelberg
18-Opal

Modelitem visibility issue

Hi Folks--

I am having a strange problem with an experience. I have an experience with a model that has multiple sequences defined. The sequence is selected via UI items (buttons) and set via Javascript. All of that works fine.

However, I have several modelItems assigned to parts of the model, with toggle buttons to show/hide them. When I load the experience, all modelItems toggle on and off correctly. However, once I've selected and played a sequence, some of the modelItems still work to toggle on/off, but some don't. I've spent a fair amount of time looking at the modelItems to see if I can spot a difference between the ones that work in a sequence and the ones that don't. I can't find anything. I've checked their properties via Javascript debugging in the preview window, and things look as they should--the "visible" property dutifully switches between true and false, but the modelItems are not visible even when Javascript reports visible=true.

I also checked the model hierarchy, to make sure the faulty modelItems weren't child parts of something else that was hidden, but they are all top-level parts in the assembly.

Anyone have any ideas what else to check to explain why some modelItems would work in that context but others would not?

--Clay

ACCEPTED SOLUTION

Accepted Solutions

For modelitems in a script I had a similar issue - so I set the visiblity to false or true but the modelitems did not follow the setting of the visiblity property . In my case the usage of 'forceHidden ' attribute did help. You can try.

Here an example:

 

// ModelLoaded event
$rootScope.$on('modelLoaded', function() {
  loadedCount++;
  if (loadedCount === 1) {
    ///////////////////////////////////////
    //Assign value to Application parameter defined in DATA
    $scope.app.params['counter'] = 0;
    console.log("modelLoaded");
    $scope.view.wdg['modelItem-door-aus']['forceHidden'] = true;
    $scope.view.wdg['modelItem-door-aus']['visible'] = true;
    $scope.view.wdg['slider-2']['value']=0;
    $scope.view.wdg['modelItem-door-aus']['forceHidden'] = false;
...

 

 

View solution in original post

10 REPLIES 10

I have seen the exact same issues. It is slightly random as in some model items will "work" and respect the modelItem settings, but other modelItems will not. I have even seen one instance where just simply adding a model item "tag" to one particular part of my model will cause it's position during a sequence to change. The part is translated maybe 400mm from where it should be but then goes thru all the movements in the sequence with this translation offset and ends up in the wrong place at the end.

 

Another example is i was planning to use modelitem properties to highlight parts in an exploded view. So i have a sequence that explodes my assembly and then you can touch a  part to get info about that part. After the touch i wanted to highlight the selected part somehow. So i was just going to assign all parts modelitems and then after the touch on part X i could change the opacity on all other parts to something like 0.4 so part X stood out. In practice this does not work at all. Half the modelitems respect this opacity change and half do not. There is no obvious pattern to the ones that work and the ones that do not. You can confirm via debug or text labels that the opacity value of these modelitems is changing but it is not reflected in what you see.

 

Seems like the sequence and the modelitem are fighting for control of item properties.

Thanks! At least I know I'm not alone...

I've also seen this behaviour.  As @jmikesell pointed out, the sequence and studio fight for control over the visibility of the part and from what I've observed the sequence wins out, unless you use the force hidden option as pointed out by @RolandRaytchev.

 

I've found that I often need to plan the visibility of items as I create the sequence in Creo Illustrate as to how that will look in AR and what I'm going to want to see/not see in AR.

For modelitems in a script I had a similar issue - so I set the visiblity to false or true but the modelitems did not follow the setting of the visiblity property . In my case the usage of 'forceHidden ' attribute did help. You can try.

Here an example:

 

// ModelLoaded event
$rootScope.$on('modelLoaded', function() {
  loadedCount++;
  if (loadedCount === 1) {
    ///////////////////////////////////////
    //Assign value to Application parameter defined in DATA
    $scope.app.params['counter'] = 0;
    console.log("modelLoaded");
    $scope.view.wdg['modelItem-door-aus']['forceHidden'] = true;
    $scope.view.wdg['modelItem-door-aus']['visible'] = true;
    $scope.view.wdg['slider-2']['value']=0;
    $scope.view.wdg['modelItem-door-aus']['forceHidden'] = false;
...

 

 

Thanks! I finally got back to this, and using forceHidden also helped for me.

--Clay

Hi @ClayHelberg,

 

I've been doing some AR stuff with the latest versions of Illustrate (5.0) and Studio (8.3.2) and it looks like the settings in Studio now override the Illustrate settings.

 

I've got a model widget that uses a sequence where everything is on, but I can create model items and set their visibility off and they don't show.  This also works for opacity.  I'm not sure if the fix is in Studio or Illustrate (or maybe both) but I'd be interested to know if it's the same for you.

 

Cheers,

 

Allan

Hi Allan--

 

I was traveling last week, and now I've got a lot of catching up to do, so it may be a while before I have a use case for testing this. But if I notice any different results, I'll post something about it here.

 

--Clay

No problems. Thanks Clay

I might have spoken to soon.  I've got some other examples that it doesn't work for.  Need to do a bit more investigating

Announcements

Top Tags