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

View DrawingBaseViewCmd

Rob987654
Participant

View DrawingBaseViewCmd

Rob987654
Participant
Participant

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

 

0 Likes
Reply
Accepted solutions (1)
515 Views
2 Replies
Replies (2)

JelteDeJong
Mentor
Mentor
Accepted solution

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
Participant
Participant

Hi @JelteDeJong ,

 

Thanks for that ilogic code. It is working perfect! 

0 Likes