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
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."
© 2024 OneMinuteCode. All rights reserved.