Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: Rob987654

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.

EESignature


Blog: hjalte.nl - github.com