OpenFrom.vb 7.5 KB
Newer Older
leaky114's avatar
leaky114 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
Imports Inventor
Imports Inventor.AssetTypeEnum
Imports Inventor.BOMStructureEnum
Imports Inventor.DocumentTypeEnum
Imports Inventor.DrawingViewTypeEnum
Imports Inventor.IOMechanismEnum
Imports Inventor.PropertyTypeEnum
Imports Inventor.SelectionFilterEnum

Module OpenFrom

    '打开自定义签字窗口
    Public Sub FrmCustomSignatureShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            If ThisApplication.ActiveDocumentType <> kDrawingDocumentObject Then
                MsgBox("该功能仅适用于工程图。", MsgBoxStyle.Information)
                Exit Sub
            End If

            Dim frmSign As New frmSign
            frmSign.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '保存关闭所有部件
    Public Sub FrmSaveCloseAllDocumentShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            Dim frmSaveAll As New frmSaveAll
            frmSaveAll.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    '打开生成图号窗口
    Public Sub FrmAutoPartNumberShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then
                MsgBox("该功能仅适用于部件。", MsgBoxStyle.Information)
                Exit Sub
            End If

            Dim AutoPartNumber As New frmAutoPartNumber
leaky114's avatar
leaky114 已提交
65
            AutoPartNumber.ShowDialog()
leaky114's avatar
leaky114 已提交
66 67 68 69 70 71 72 73 74 75 76
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '打开技术要求窗口
    Public Sub FrmSpecificationShow()
        Try
            SetStatusBarText()

leaky114's avatar
leaky114 已提交
77 78 79
            'If IsInventorOpenDocument() = False Then
            '    Exit Sub
            'End If
leaky114's avatar
leaky114 已提交
80

leaky114's avatar
leaky114 已提交
81 82 83 84
            'If ThisApplication.ActiveDocumentType <> kDrawingDocumentObject Then
            '    MsgBox("该功能仅适用于工程图。", MsgBoxStyle.Information)
            '    Exit Sub
            'End If
leaky114's avatar
leaky114 已提交
85 86 87 88 89 90 91 92 93 94 95 96 97 98

            Dim frmSpecification As New frmSpecification
            frmSpecification.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '打开批量打印窗口
    Public Sub FrmBulkPrintShow()
        Try
            SetStatusBarText()
            Dim frmPrint As New frmPrint
leaky114's avatar
leaky114 已提交
99
            frmPrint.ShowDialog()
leaky114's avatar
leaky114 已提交
100 101 102 103 104 105 106 107 108 109 110
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '打开查询erp编码窗口
    Public Sub FrmQueryERPcodeshow()
        Try
            SetStatusBarText()
            Dim frmSearchERPCode As New frmSearchERPCode
leaky114's avatar
leaky114 已提交
111
            frmSearchERPCode.ShowDialog()
leaky114's avatar
leaky114 已提交
112 113 114 115 116 117 118 119 120 121 122
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '打开反查erp编码
    Public Sub ReverseCheckERPCodesshow()
        Try
            SetStatusBarText()
            Dim frmERPCodeSearch As New frmERPCodeSearch
leaky114's avatar
leaky114 已提交
123
            frmERPCodeSearch.ShowDialog()
leaky114's avatar
leaky114 已提交
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '导入ERP编码到excel文件
    Public Sub FrmImportCodeToIamShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then
                MsgBox("该功能仅适用于部件。", MsgBoxStyle.Information)
                Exit Sub
            End If

leaky114's avatar
leaky114 已提交
144 145
            Dim frmImportCodeToIam As New frmImportCodeToIam
            frmImportCodeToIam.ShowDialog()
leaky114's avatar
leaky114 已提交
146 147 148 149 150 151 152 153 154 155 156
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '导入ERP编码到excel文件
    Public Sub FrmImportERPCodeToExcelshow()
        Try
            SetStatusBarText()

leaky114's avatar
leaky114 已提交
157 158 159
            'If IsInventorOpenDocument() = False Then
            '    Exit Sub
            'End If
leaky114's avatar
leaky114 已提交
160 161

            Dim frmImportCodeToBomExcel As New frmImportCodeToBomExcel
leaky114's avatar
leaky114 已提交
162
            frmImportCodeToBomExcel.ShowDialog()
leaky114's avatar
leaky114 已提交
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    'm_打开ERP数据文件_Buttondef_OnExecute
    Public Sub OpenBasicExcel()
        Try
            If IsFileExsts(BasicExcelFullFileName) Then
                Process.Start(BasicExcelFullFileName)
            Else
                Process.Start(My.Application.Info.DirectoryPath)
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    '打开设置窗口
    Public Sub FrmOptionshow()
        Dim frmOption As New frmOption
        frmOption.ShowDialog()

    End Sub

    '打开全部另存为
    Public Sub FrmAllSaveAsShow()

        Dim SaveAsDialog As New frmSaveAs
        SaveAsDialog.ShowDialog()

    End Sub

    '打开iproperty窗口
    Public Sub FrmChangeIproShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            Dim frmChangeIpro As New frmChangeIpro
            frmChangeIpro.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    '打开iproperty量产窗口
    Public Sub frmMassiPopertiesshow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            Dim frmMassiPoperties As New frmMassiPoperties
            frmMassiPoperties.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

    '打开统计面积质量窗口
    Public Sub frmGetPartshow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then
                MsgBox("该功能仅适用于部件。", MsgBoxStyle.Information)
                Exit Sub
            End If

            Dim frmGetPart As New frmGetPart
leaky114's avatar
leaky114 已提交
245
            frmGetPart.ShowDialog()
leaky114's avatar
leaky114 已提交
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub


    '打开设置文件属性窗口
    Public Sub FrmSetWriteOnlyShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then
                MsgBox("该功能仅适用于部件。", MsgBoxStyle.Information)
                Exit Sub
            End If

            Dim frmSetWriteOnly As New frmSetWriteOnly
leaky114's avatar
leaky114 已提交
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
            frmSetWriteOnly.ShowDialog()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub


    '打开编辑尺寸窗口
    Public Sub FrmEditDimensionShow()
        Try
            SetStatusBarText()

            If IsInventorOpenDocument() = False Then
                Exit Sub
            End If

            If ThisApplication.ActiveEditDocument.DocumentType <> kPartDocumentObject Then
                MsgBox("该功能仅适用于零件。", MsgBoxStyle.Information)
                Exit Sub
            End If

            Dim frmEditDimension As New frmEditDimension
            frmEditDimension.ShowDialog()

leaky114's avatar
leaky114 已提交
293 294 295 296 297 298 299
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

    End Sub

End Module