Gets the name of the last model successfully opened by SOLIDWORKS and the options that were in effect when it opened.
.NET Syntax
Visual Basic (Declaration) | |
---|
Sub GetOpenedFileInfo( _
ByRef FileName As System.String, _
ByRef Options As System.Integer _
) |
Visual Basic (Usage) | |
---|
Dim instance As ISldWorks
Dim FileName As System.String
Dim Options As System.Integer
instance.GetOpenedFileInfo(FileName, Options) |
C# | |
---|
void GetOpenedFileInfo(
out System.string FileName,
out System.int Options
) |
C++/CLI | |
---|
void GetOpenedFileInfo(
& [Out] System.String^ FileName,
& [Out] System.int Options
) |
Parameters
- FileName
- Full path and filename of the last model successfully opened by SOLIDWORKS
- Options
- Options in effect when FileName opened as defined in swOpenDocOptions_e
Example
'VBA
Dim swApp As SldWorks.SldWorks
Dim path As String
Dim docspec As SldWorks.DocumentSpecification
Dim opened As String
Dim Options As Long
Dim Part As SldWorks.ModelDoc2
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Option Explicit
Sub main()
Set swApp = Application.SldWorks
swApp.CloseAllDocuments True
path = "C:\Users\Public\Documents\SOLIDWORKS\SOLIDWORKS 2018\tutorial\api\bagel.sldprt"
Set docspec = swApp.GetOpenDocSpec(path)
Set Part = swApp.OpenDoc7(docspec)
Set Part = swApp.OpenDoc6("C:\Users\Public\Documents\SOLIDWORKS\SOLIDWORKS 2018\tutorial\api\coffeecup.sldprt", 1, 0, "", longstatus, longwarnings)
Set Part = swApp.OpenDoc6("C:\Users\Public\Documents\SOLIDWORKS\SOLIDWORKS 2018\tutorial\api\toaster.sldprt", 1, 0, "", longstatus, longwarnings)
' None of the above documents successfully opened through the API get returned by GetOpenedFileInfo
swApp.GetOpenedFileInfo opened, Options
Debug.Print "Last successfully opened file: " & opened
Debug.Print "Options as defined in swOpenDocOptions_e: " & Options
End Sub
Remarks
See Also
Availability
SOLIDWORKS 2005 FCS, Revision Number 13.0