Running MdiActiveDocument on IJCAD Stops

Asked 2 years ago, Updated 2 years ago, 107 views

I am developing using VB.Net at IJCAD 2015.

I tried to create code to activate specific documents from open documents in IJCAD.After performing the step, the MdiActiveDocument stops.What is the cause?

Public Shared Function SetActiveDocument (ByVal docName As String) As Boolean

    Dim docMan As DocumentCollection = Application.DocumentManager

    For Each doc As Document IndocMan

        If doc.Name.ToUpper=docName.ToUpper Then
            '' ↓ It will stop here
            docMan.MdiActiveDocument=doc
            Return True
        End If

    Next

    Return False

End Function

vb.net ijcad

2022-09-30 20:24

1 Answers

It is likely that CommandFlags.Modal is configured in CommandFlags.Session in the command to invoke Function, so setting CommandFlags.Session is likely to solve the problem.

The former runs in the "Document Execution Context" and the latter in the "Application Execution Context."


2022-09-30 20:24

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.