I am working on some codes that let me make some change on visibility of occurence. So I am I main assembly, and 3 ocurences of the same sub-assembly. The sub assembly was saved on a design view named hole that is hidding some occurences.
if I work with one of those sub assembly (checkOcc as componentoccurence)
and then I try this:
Debug.Print("Occurence name: " + CheckOcc.Name)
Debug.Print("Is DRV associative: " + CheckOcc.IsAssociativeToDesignViewRepresentation.ToString)
Debug.Print("The Active DRV is: " + CheckOcc.ActiveDesignViewRepresentation.ToString)
CheckOcc.SetDesignViewRepresentation("Default")
Debug.Print("Is DRV associative: " + CheckOcc.IsAssociativeToDesignViewRepresentation.ToString)
Debug.Print("The Active DRV is: " + CheckOcc.ActiveDesignViewRepresentation.ToString)
The fist ime I check for the name, the result is empty, but is should hole as it's what I can see in the browser.
then I change it to default
The result of that, the representation views disapear from the browser for that occurence and still, the name is return as empty...
then I carry on with turning on the hidden occurences.
objCol.Add(checkocc)
dv.SetVisibilityOfOccurrences(objCol, visibility)
The result, all the hidden occurence appear ALSO on the other subassemblies... It look that it's affecting all the Designview of all occurence of that name...
then, if I try the reverse, by turning it off... the switch off on the other occurences but not the one that is checkocc!!!
Now I am lost on the way it is working... if I do it manually in the application. I don't have that funcky behavior!
Hi Patrick,
The disappearing browser nodes is logged in our system with title: " SetDesignViewRepresentation makes the View node of the occurrence disappear"
You could probably workaround this by selecting the node in the browser programmatically and then running the command that will activate it.
But I could not reproduce the problem with the ActiveDesignViewRepresentation as it gave back the correct name.
Could you provide a non-confidential sample assembly to reproduce the problem?
Which Inventor version are you using?
Cheers,