'Usage Agreement
'The software/macro/customization is supplied “as is” and all use is at your own risk.  GoEngineer disclaims all warranties of any kind, either express or implied, as to the
'features and functionality.  Neither this agreement nor any documentation furnished under it is intended to neither express or imply any warranty that the operation of the
'software will be error‐free nor cause undesirable results on files that it is ran against.  Under no circumstances shall GoEngineer be liable to any user for direct, indirect, 
'incidental, consequential, special, or exemplary damages, arising from or relating to this agreement, the software, or users use or misuse of the software or any other services 
'provided by GoEngineer. Such limitation of liability shall apply whether the damages arise from the use or misuse of the software or any other services supplied by GoEngineer
'(including such damages incurred by third parties), or errors of the software. Use of the software/macro/customization constitutes acceptance to this agreement.

Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System.Runtime.InteropServices
Imports System
Imports System.Windows.Forms

Partial Class SolidWorksMacro

    Public Sub main()
        If swApp.ActiveDoc Is Nothing Then
            MessageBox.Show("You must have a part or assembly open to analyze!", "ActiveDoc is NULL...", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
        Else
            If DirectCast(swApp.ActiveDoc, ModelDoc2).GetType() = 3 Then
                MessageBox.Show("This macro can only be ran on parts and assemblies!", "Drawings Not Allowed...", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
            Else
                Dim fa As New FileAnalyzer()
                fa.swApp = swApp
                fa.ShowDialog()
            End If
        End If
    End Sub

    ''' <summary>
    ''' The SldWorks swApp variable is pre-assigned for you.
    ''' </summary>
    Public swApp As SldWorks


End Class
