Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Rob987654
515 Views, 2 Replies

View DrawingBaseViewCmd

Hi,

 

How can I keep the DrawingBaseViewCmd visible, to give the user the possibility to directly change drawing view settings. 

 

Part of ilogic code:

 

sFileName = oPartTest.FullFileName
ThisApplication.CommandManager.PostPrivateEvent(kFileNameEvent,
sFileName)
oTest = ThisApplication.CommandManager.ControlDefinitions.Item("DrawingBaseViewCmd")
oTest.Execute

 

Labels (1)
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

Rob987654
in reply to: JelteDeJong

Hi @JelteDeJong ,

 

Thanks for that ilogic code. It is working perfect!