Get SolidWorks Version Number in which Feature Was Created Example
(VBA)
This example shows how to get the SolidWorks version number in which
the selected feature was created.
'------------------------------------------------------------------
'
' Preoconditions: Model document is open and a feature
is selected.
'
' Postconditions: None
'
'-------------------------------------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swFeat As SldWorks.Feature
Sub main()
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set swFeat = swSelMgr.GetSelectedObject5(1)
Debug.Print "Feature = " + swFeat.Name
+ "[" + swFeat.GetTypeName
+ "}"
Debug.Print "Version of SolidWorks in which feature
was created = " & swFeat.getcreatedversion
End Sub