At present only one OpenSTAAD object can be retrieved which acts globally for the Staad application which limits the efficient use of Staad. With the ever increasing system resources, having distinct OpenSTAAD objects for each instance of Staad will help in interacting programmatically with multiple models simultaneously.
Thank you for posting this idea. However, it is possible to access the data from multiple instances of STAAD.Pro. The only thing you need to do is change the way the set command is defined to also include the full name and path of the relevant STAAD.Pro model. For example if you had three models open from the samples folder and wanted to report the number of nodes in each you could use the following:-
Option Explicit
Sub Main
Dim objOpenStaad1 As Object
Dim objOpenStaad2 As Object
Dim objOpenStaad3 As Object
Dim stdFile1 As String
Dim stdFile2 As String
Dim stdFile3 As String
Set objOpenStaad1 = GetObject ("C:\Users\Public\Documents\STAAD.Pro 2023\Samples\Sample Models\UK\UK-1 Plane Frame with Steel Design.STD")
Set objOpenStaad2 = GetObject("C:\Users\Public\Documents\STAAD.Pro 2023\Samples\Sample Models\UK\UK-2 Area Load Generation on Floor Structure.STD")
Set objOpenStaad3 = GetObject("C:\Users\Public\Documents\STAAD.Pro 2023\Samples\Sample Models\UK\UK-3 Soil Springs for Portal Frame.STD")
'Set objOpenStaad = GetObject(,"StaadPro.OpenSTAAD")
objOpenStaad1.GetSTAADFile stdFile1, "TRUE"
objOpenStaad2.GetSTAADFile stdFile2, "TRUE"
objOpenStaad3.GetSTAADFile stdFile3, "TRUE"
MsgBox "Nodes in model 1" & Str(Val(objOpenStaad1.Geometry.GetNodeCount()))
MsgBox "Nodes in model 2" & Str(Val(objOpenStaad2.Geometry.GetNodeCount()))
MsgBox "Nodes in model 3" & Str(Val(objOpenStaad3.Geometry.GetNodeCount()))
MsgBox"Macro Ending"
Set objOpenStaad1 = Nothing
Set objOpenStaad2 = Nothing
Set objOpenStaad3 = Nothing
End Sub