- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Justin,
Thanks for your feedback.
I tried that but it makes not difference. It still runs through each view rep and I can see the camera properties change in the watch window as I step through the code, but the view is not updating in the graphics window.
At the line "oView.Activate" the graphic window changes to the correct view, but, at the line "oCamera.Apply" the viewing eye, target and upvector do not appear to be changing in the graphics window. The view remains in exactly the same as it was before, and then the code steps on to the next design view representation in the collection.
Private Sub ProcessViews(frmViewCameraCopy As frm_ViewCameraCopy)
Dim oView As Inventor.DesignViewRepresentation
Dim activeViewName As String
Dim oCamera As Inventor.Camera
Dim oBaseView As Inventor.DesignViewRepresentation
Dim oColTargetViews As New Collection
Dim oCompDef As ComponentDefinition
Set oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
For Each oView In _
oCompDef.RepresentationsManager.DesignViewRepresentations
If oView.Name = frmViewCameraCopy.BaseViewName Then
Set oBaseView = oView
End If
For Each Item In frmViewCameraCopy.ViewsToProcess
If Item = oView.Name Then
oColTargetViews.Add oView
End If
Next
Next
activeViewName = oCompDef.RepresentationsManager.ActiveDesignViewRepresentation.Name
Dim waslocked As Boolean
Set oActiveView = ThisApplication.ActiveView
For Each oView In oColTargetViews
If oView.Locked Then
waslocked = True
oView.Locked = False
Else
waslocked = False
End If
oView.Activate
Set oCamera = oView.Camera
oCamera.Target = oBaseView.Camera.Target
oCamera.Eye = oBaseView.Camera.Eye
oCamera.UpVector = oBaseView.Camera.UpVector
oCamera.Apply
'oView.Camera.Target = oBaseView.Camera.Target
'oView.Camera.Eye = oBaseView.Camera.Eye
'oView.Camera.UpVector = oBaseView.Camera.UpVector
'oView.Camera.Apply
oView.Locked = waslocked
Next
oCompDef.RepresentationsManager.DesignViewRepresentations.Item(activeViewName).Activate
End Sub
Rob
-------------------------------------------
Windows 7 Pro (X64)
Intel(R) core (TM) i5-4690 CPU @ 3.50GHz
32.0 GB RAM
Nvidia Quadro K2000
Autodesk Inventor 2015 Professional Ultimate Design Suite