Design View Representations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am busy writing some VBA code to copy the viewing eye, target and upvector from one design view rep to several others. My code is not working and I do not understand why not. Any ideas / suggestions please.
Private Sub ProcessViews(frmViewCameraCopy As frm_ViewCameraCopy)
Dim oView As Inventor.DesignViewRepresentation
Dim activeViewName As String
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
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