- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm running into an odd problem I can't figure out regarding DesignViewRepresentations
via VB I'm opening a document, setting the activeview (whatever it is, upon opening)
Private Sub ViewMaker()
Dim curDoc As AssemblyDocument = InvApp.ActiveDocument
Dim curDocDef As AssemblyComponentDefinition = curDoc.ComponentDefinition
Dim dViewRepper As RepresentationsManager = curDocDef.RepresentationsManager
Dim actView As DesignViewRepresentation = dViewRepper.ActiveDesignViewRepresentation
dCurView = actView.Name
'See if it's there, first
Try
dNewView = dViewRepper.DesignViewRepresentations.Item("CMM")
Catch ex As Exception
dNewView = dViewRepper.DesignViewRepresentations.Add("CMM")
End Try
dNewView.Activate()
dNewView.Locked = False
dNewView.ShowAll()
dNewView.Camera = InvApp.ActiveView.Camera
dNewView.Camera.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopRightViewOrientation
dNewView.Camera.Fit()
dNewView.Camera.Apply()
End Sub
Then I call "ViewReverter" on the same document
Private Sub ViewReverter()
dNewView.Locked = True
Dim vAsmCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
vAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item(dCurView).Activate()
End Sub
So the resultant condition is that:
The "current view" is active, but the visibility of the objects is incorrect. I'm creating a new view, turning visibility off, then activating the previous view, and moving on to the next document to do likewise.
However, it activates the previous view, but doesn't update the visibility - everything looks as it does in the new "CMM" view with many things not visibile.
Say the previous view was 'Default': I can double-click the CMM view - it looks accurate, then double-click the 'Default' view and it now looks correct.
It's like it's activating the view, but not updating something important.
Any ideas?
Solved! Go to Solution.