hi, does this work or you?
Dim doc As DrawingDocument = ThisApplication.ActiveDocument
' Make a list of the views. For use later
Dim knowViews As List(Of String) = New List(Of String)
For Each view As DrawingView In doc.ActiveSheet.DrawingViews
knowViews.Add(View.Name)
Next
' Create a drawingview
Dim sFileName = oPartTest.FullFileName
ThisApplication.CommandManager.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, sFileName)
Dim oTest = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingBaseViewCmd")
oTest.Execute2(True)
' find the view that was just added and (re)start command
For Each view As DrawingView In doc.ActiveSheet.DrawingViews
If (knowViews.Contains(View.Name) = False) Then
doc.SelectSet.Clear()
doc.SelectSet.Select(View)
ThisApplication.CommandManager.ControlDefinitions.Item("DrawingViewEditCtxCmd").Execute()
Exit For
End If
Next
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog: hjalte.nl - github.com