提交 2b2c1d3f 编写于 作者: leaky114's avatar leaky114

新增重新BOM序号与排序

新增部分图标
修正BOM导出项目下拉菜单无成本中心选项
修改对话输入框细节
增加启动检查更新设置【设置】【启动时检查更新】
取消批量打印后关闭工程图
上级 17427d03
...@@ -28,5 +28,5 @@ Imports System.Runtime.InteropServices ...@@ -28,5 +28,5 @@ Imports System.Runtime.InteropServices
' You can specify all the values or you can default the Build and Revision Numbers ' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below: ' by using the '*' as shown below:
<Assembly: AssemblyVersion("1.21.7.22")> <Assembly: AssemblyVersion("1.21.10.19")>
<Assembly: AssemblyFileVersionAttribute("1.21.7.22")> <Assembly: AssemblyFileVersionAttribute("1.21.10.19")>
\ No newline at end of file \ No newline at end of file
...@@ -27,13 +27,16 @@ Public NotInheritable Class About ...@@ -27,13 +27,16 @@ Public NotInheritable Class About
End Sub End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try 'Try
Dim simupdate As String ' Dim simupdate As String
' simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe"
' Process.Start(simupdate)
'Catch ex As Exception
' MsgBox(ex.Message)
'End Try
NewUpdater.UpDater2()
simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe"
Process.Start(simupdate)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub End Sub
End Class End Class
...@@ -75,7 +75,7 @@ Partial Class ChangeIproDialog ...@@ -75,7 +75,7 @@ Partial Class ChangeIproDialog
Me.Label1.Name = "Label1" Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(65, 60) Me.Label1.Size = New System.Drawing.Size(65, 60)
Me.Label1.TabIndex = 1 Me.Label1.TabIndex = 1
Me.Label1.Text = "零件代号:" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "库存编号:" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "描 述:" Me.Label1.Text = "图 号:" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "文 件 名:" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "描 述:"
' '
'TextBox1 'TextBox1
' '
...@@ -83,6 +83,7 @@ Partial Class ChangeIproDialog ...@@ -83,6 +83,7 @@ Partial Class ChangeIproDialog
Me.TextBox1.Name = "TextBox1" Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(164, 21) Me.TextBox1.Size = New System.Drawing.Size(164, 21)
Me.TextBox1.TabIndex = 2 Me.TextBox1.TabIndex = 2
Me.TextBox1.WordWrap = False
' '
'TextBox2 'TextBox2
' '
......
...@@ -7,8 +7,8 @@ Public Class ChangeIproDialog ...@@ -7,8 +7,8 @@ Public Class ChangeIproDialog
Dim InventorDoc As Document Dim InventorDoc As Document
InventorDoc = ThisApplication.ActiveEditDocument InventorDoc = ThisApplication.ActiveEditDocument
SetPropitem(InventorDoc, "零件代号", TextBox1.Text) SetPropitem(InventorDoc, Map_StochNum, TextBox1.Text)
SetPropitem(InventorDoc, "库存编号", TextBox2.Text) SetPropitem(InventorDoc, Map_PartName, TextBox2.Text)
SetPropitem(InventorDoc, "描述", TextBox3.Text) SetPropitem(InventorDoc, "描述", TextBox3.Text)
Me.DialogResult = System.Windows.Forms.DialogResult.OK Me.DialogResult = System.Windows.Forms.DialogResult.OK
...@@ -35,9 +35,9 @@ Public Class ChangeIproDialog ...@@ -35,9 +35,9 @@ Public Class ChangeIproDialog
Dim StockNumPartName As StockNumPartName = Nothing Dim StockNumPartName As StockNumPartName = Nothing
For Each propitem In oPropSet For Each propitem In oPropSet
Select Case propitem.DisplayName Select Case propitem.DisplayName
Case "零件代号" Case Map_StochNum
TextBox1.Text = propitem.Value TextBox1.Text = propitem.Value
Case "库存编号" Case Map_PartName
TextBox2.Text = propitem.Value TextBox2.Text = propitem.Value
Case "描述" Case "描述"
TextBox3.Text = propitem.Value TextBox3.Text = propitem.Value
...@@ -59,4 +59,6 @@ Public Class ChangeIproDialog ...@@ -59,4 +59,6 @@ Public Class ChangeIproDialog
TextBox2.Text = TextBox3.Text TextBox2.Text = TextBox3.Text
TextBox3.Text = Str_TempText TextBox3.Text = Str_TempText
End Sub End Sub
End Class End Class
...@@ -74,6 +74,8 @@ Public Class InventoryCoding ...@@ -74,6 +74,8 @@ Public Class InventoryCoding
If opfile.FileName <> "" Then '如果有选中文件 If opfile.FileName <> "" Then '如果有选中文件
ExcelFullFileName = opfile.FileName ExcelFullFileName = opfile.FileName
End If End If
Else
Exit Sub
End If End If
If Lead_InventoryCoding(ExcelFullFileName, ListView1) Then If Lead_InventoryCoding(ExcelFullFileName, ListView1) Then
......
...@@ -64,6 +64,7 @@ Partial Class OptionDialog ...@@ -64,6 +64,7 @@ Partial Class OptionDialog
Me.CheckBox4 = New System.Windows.Forms.CheckBox Me.CheckBox4 = New System.Windows.Forms.CheckBox
Me.TextBox7 = New System.Windows.Forms.TextBox Me.TextBox7 = New System.Windows.Forms.TextBox
Me.Label11 = New System.Windows.Forms.Label Me.Label11 = New System.Windows.Forms.Label
Me.CheckBox5 = New System.Windows.Forms.CheckBox
Me.TableLayoutPanel1.SuspendLayout() Me.TableLayoutPanel1.SuspendLayout()
Me.GroupBox1.SuspendLayout() Me.GroupBox1.SuspendLayout()
Me.GroupBox2.SuspendLayout() Me.GroupBox2.SuspendLayout()
...@@ -339,7 +340,7 @@ Partial Class OptionDialog ...@@ -339,7 +340,7 @@ Partial Class OptionDialog
' '
Me.ComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.ComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.ComboBox3.FormattingEnabled = True Me.ComboBox3.FormattingEnabled = True
Me.ComboBox3.Items.AddRange(New Object() {"材料", "空格", "存货编号", "零件代号", "描述", "数量", "所属装配", "所属装配代号", "文件路径", "文件名", "质量", "面积", "总数量"}) Me.ComboBox3.Items.AddRange(New Object() {"材料", "空格", "存货编号", "零件代号", "成本中心", "描述", "数量", "所属装配", "所属装配代号", "文件路径", "文件名", "质量", "面积", "总数量"})
Me.ComboBox3.Location = New System.Drawing.Point(254, 51) Me.ComboBox3.Location = New System.Drawing.Point(254, 51)
Me.ComboBox3.Name = "ComboBox3" Me.ComboBox3.Name = "ComboBox3"
Me.ComboBox3.Size = New System.Drawing.Size(170, 20) Me.ComboBox3.Size = New System.Drawing.Size(170, 20)
...@@ -491,6 +492,18 @@ Partial Class OptionDialog ...@@ -491,6 +492,18 @@ Partial Class OptionDialog
Me.Label11.TabIndex = 4 Me.Label11.TabIndex = 4
Me.Label11.Text = "比例:" Me.Label11.Text = "比例:"
' '
'CheckBox5
'
Me.CheckBox5.AutoSize = True
Me.CheckBox5.Checked = True
Me.CheckBox5.CheckState = System.Windows.Forms.CheckState.Checked
Me.CheckBox5.Location = New System.Drawing.Point(25, 413)
Me.CheckBox5.Name = "CheckBox5"
Me.CheckBox5.Size = New System.Drawing.Size(108, 16)
Me.CheckBox5.TabIndex = 13
Me.CheckBox5.Text = "启动时检查更新"
Me.CheckBox5.UseVisualStyleBackColor = True
'
'OptionDialog 'OptionDialog
' '
Me.AcceptButton = Me.OK_Button Me.AcceptButton = Me.OK_Button
...@@ -498,6 +511,7 @@ Partial Class OptionDialog ...@@ -498,6 +511,7 @@ Partial Class OptionDialog
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.Cancel_Button Me.CancelButton = Me.Cancel_Button
Me.ClientSize = New System.Drawing.Size(533, 458) Me.ClientSize = New System.Drawing.Size(533, 458)
Me.Controls.Add(Me.CheckBox5)
Me.Controls.Add(Me.GroupBox7) Me.Controls.Add(Me.GroupBox7)
Me.Controls.Add(Me.GroupBox6) Me.Controls.Add(Me.GroupBox6)
Me.Controls.Add(Me.GroupBox5) Me.Controls.Add(Me.GroupBox5)
...@@ -529,6 +543,7 @@ Partial Class OptionDialog ...@@ -529,6 +543,7 @@ Partial Class OptionDialog
Me.GroupBox7.ResumeLayout(False) Me.GroupBox7.ResumeLayout(False)
Me.GroupBox7.PerformLayout() Me.GroupBox7.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout()
End Sub End Sub
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
...@@ -573,5 +588,6 @@ Partial Class OptionDialog ...@@ -573,5 +588,6 @@ Partial Class OptionDialog
Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents ComboBox6 As System.Windows.Forms.ComboBox Friend WithEvents ComboBox6 As System.Windows.Forms.ComboBox
Friend WithEvents Label12 As System.Windows.Forms.Label Friend WithEvents Label12 As System.Windows.Forms.Label
Friend WithEvents CheckBox5 As System.Windows.Forms.CheckBox
End Class End Class
...@@ -35,7 +35,7 @@ Public Class OptionDialog ...@@ -35,7 +35,7 @@ Public Class OptionDialog
Case CheckState.Unchecked Case CheckState.Unchecked
IsDayAndName = -1 IsDayAndName = -1
Case CheckState.Indeterminate Case CheckState.Indeterminate
IsDayAndName = 0S IsDayAndName = 0
Case CheckState.Checked Case CheckState.Checked
IsDayAndName = 1 IsDayAndName = 1
End Select End Select
...@@ -45,7 +45,7 @@ Public Class OptionDialog ...@@ -45,7 +45,7 @@ Public Class OptionDialog
Case CheckState.Unchecked Case CheckState.Unchecked
IsSetDrawingScale = -1 IsSetDrawingScale = -1
Case CheckState.Indeterminate Case CheckState.Indeterminate
IsSetDrawingScale = 0S IsSetDrawingScale = 0
Case CheckState.Checked Case CheckState.Checked
IsSetDrawingScale = 1 IsSetDrawingScale = 1
End Select End Select
...@@ -55,11 +55,22 @@ Public Class OptionDialog ...@@ -55,11 +55,22 @@ Public Class OptionDialog
Case CheckState.Unchecked Case CheckState.Unchecked
IsSetMass = -1 IsSetMass = -1
Case CheckState.Indeterminate Case CheckState.Indeterminate
IsSetMass = 0S IsSetMass = 0
Case CheckState.Checked Case CheckState.Checked
IsSetMass = 1 IsSetMass = 1
End Select End Select
'启动检查更新
Select Case CheckBox5.CheckState
Case CheckState.Unchecked
CheckUpdate = -1
Case CheckState.Indeterminate
CheckUpdate = 0
Case CheckState.Checked
CheckUpdate = 1
End Select
'质量精度: '质量精度:
Select Case ComboBox4.Text Select Case ComboBox4.Text
Case "", "0" Case "", "0"
...@@ -115,6 +126,8 @@ Public Class OptionDialog ...@@ -115,6 +126,8 @@ Public Class OptionDialog
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\InventorTool", "Mass_Accuracy", Mass_Accuracy) My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\InventorTool", "Mass_Accuracy", Mass_Accuracy)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\InventorTool", "Area_Accuracy", Area_Accuracy) My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\InventorTool", "Area_Accuracy", Area_Accuracy)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\InventorTool", "CheckUpdate", CheckUpdate)
Me.DialogResult = System.Windows.Forms.DialogResult.OK Me.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Close() Me.Close()
End Sub End Sub
...@@ -205,6 +218,15 @@ Public Class OptionDialog ...@@ -205,6 +218,15 @@ Public Class OptionDialog
CheckBox4.CheckState = CheckState.Checked CheckBox4.CheckState = CheckState.Checked
End Select End Select
Select Case CheckUpdate
Case -1
CheckBox5.CheckState = CheckState.Unchecked
Case 0
CheckBox5.CheckState = CheckState.Indeterminate
Case 1
CheckBox5.CheckState = CheckState.Checked
End Select
End Sub End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button添加.Click Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button添加.Click
......
...@@ -235,6 +235,7 @@ Partial Class PrintIPWDialog ...@@ -235,6 +235,7 @@ Partial Class PrintIPWDialog
Me.ListView1.Location = New System.Drawing.Point(15, 11) Me.ListView1.Location = New System.Drawing.Point(15, 11)
Me.ListView1.Name = "ListView1" Me.ListView1.Name = "ListView1"
Me.ListView1.Size = New System.Drawing.Size(670, 314) Me.ListView1.Size = New System.Drawing.Size(670, 314)
Me.ListView1.Sorting = System.Windows.Forms.SortOrder.Ascending
Me.ListView1.TabIndex = 36 Me.ListView1.TabIndex = 36
Me.ListView1.UseCompatibleStateImageBehavior = False Me.ListView1.UseCompatibleStateImageBehavior = False
Me.ListView1.View = System.Windows.Forms.View.Details Me.ListView1.View = System.Windows.Forms.View.Details
......
...@@ -46,12 +46,15 @@ Public Class PrintIPWDialog ...@@ -46,12 +46,15 @@ Public Class PrintIPWDialog
Print_Day = Today.Year & "." & Today.Month & "." & Today.Day Print_Day = Today.Year & "." & Today.Month & "." & Today.Day
'设置签字 '设置签字
SetSign(IdwDoc, EngineerName, Print_Day, False)
If CheckBox2.CheckState = CheckState.Checked Then
SetSign(IdwDoc, EngineerName, Print_Day, False)
End If
'打印文件 '打印文件
PrintDrawing(IdwDoc, sPrinterName) PrintDrawing(IdwDoc, sPrinterName)
IdwDoc.Close(True) 'IdwDoc.Close(False)
999: 999:
Next Next
...@@ -209,6 +212,8 @@ Public Class PrintIPWDialog ...@@ -209,6 +212,8 @@ Public Class PrintIPWDialog
.Orientation = PrintOrientationEnum.kPortraitOrientation .Orientation = PrintOrientationEnum.kPortraitOrientation
End Select End Select
' Set to print all sheets. ' Set to print all sheets.
.PrintRange = PrintRangeEnum.kPrintAllSheets .PrintRange = PrintRangeEnum.kPrintAllSheets
...@@ -320,4 +325,6 @@ Public Class PrintIPWDialog ...@@ -320,4 +325,6 @@ Public Class PrintIPWDialog
MsgBox(ex.Message) MsgBox(ex.Message)
End Try End Try
End Sub End Sub
End Class End Class
...@@ -62,6 +62,8 @@ Module InventorBasic ...@@ -62,6 +62,8 @@ Module InventorBasic
Public IsSetMass As Short '打开工程图时是否写 质量 到ipro 是赋值为1 Public IsSetMass As Short '打开工程图时是否写 质量 到ipro 是赋值为1
Public CheckUpdate As Short '启动检查更新
Public TotalItem As Integer 'BOM序号 Public TotalItem As Integer 'BOM序号
Public OPosition(9) As Point '点 Public OPosition(9) As Point '点
...@@ -2159,29 +2161,17 @@ Module InventorBasic ...@@ -2159,29 +2161,17 @@ Module InventorBasic
End Sub End Sub
'保存文件时的事件 '保存文件时的事件
Public Sub ThisApplicationEvents_OnOnSaveDocument(ByVal DocumentObject As Inventor._Document, _ 'Public Sub ThisApplicationEvents_OnOnSaveDocument(ByVal DocumentObject As Inventor._Document, _
ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ ' ByVal BeforeOrAfter As Inventor.EventTimingEnum, _
ByVal Context As Inventor.NameValueMap, _ ' ByVal Context As Inventor.NameValueMap, _
ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles ThisApplicationEvents.OnSaveDocument ' ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles ThisApplicationEvents.OnSaveDocument
'当打开文件为工程图
If DocumentObject.DocumentType = kDrawingDocumentObject Then
'写入主视图比例
If IsSetDrawingScale = 1 Then
SetDrawingScale(DocumentObject)
End If
'写入零部件质量
If IsSetMass = 1 Then
SetMass(DocumentObject)
End If
End If
End Sub 'End Sub
'打开文件时的事件 '打开文件时的事件
Public Sub ThisApplicationEvents_OnOpenDocument(ByVal DocumentObject As Inventor._Document, _ Public Sub ThisApplicationEvents_OnOpenDocument(ByVal DocumentObject As Inventor._Document, _
...@@ -2204,13 +2194,24 @@ Module InventorBasic ...@@ -2204,13 +2194,24 @@ Module InventorBasic
End Sub End Sub
'激活一个文档时的事件 '激活一个文档时的事件
'Public Sub ThisApplicationEvents_OnActivateDocument(ByVal DocumentObject As Inventor._Document, _ Public Sub ThisApplicationEvents_OnActivateDocument(ByVal DocumentObject As Inventor._Document, _
' ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ ByVal BeforeOrAfter As Inventor.EventTimingEnum, _
' ByVal Context As Inventor.NameValueMap, _ ByVal Context As Inventor.NameValueMap, _
' ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles ThisApplicationEvents.OnActivateDocument ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles ThisApplicationEvents.OnActivateDocument
'当打开文件为工程图
If DocumentObject.DocumentType = kDrawingDocumentObject Then
'写入主视图比例
If IsSetDrawingScale = 1 Then
SetDrawingScale(DocumentObject)
End If
'写入零部件质量
If IsSetMass = 1 Then
SetMass(DocumentObject)
End If
End If
'End Sub End Sub
'刷新引用 '刷新引用
Public Function RefreshShowName(ByVal AsmDoc As Document) As Boolean Public Function RefreshShowName(ByVal AsmDoc As Document) As Boolean
......
...@@ -25,7 +25,11 @@ Module NewUpdater ...@@ -25,7 +25,11 @@ Module NewUpdater
Catch ex As Exception Catch ex As Exception
<<<<<<< HEAD
MsgBox(ex.Message) MsgBox(ex.Message)
=======
'MsgBox(ex.Message)
>>>>>>> c3706ff (新增重新BOM序号与排序)
End Try End Try
End Sub End Sub
...@@ -49,14 +53,26 @@ Module NewUpdater ...@@ -49,14 +53,26 @@ Module NewUpdater
'MsgBox(MyVersion) 'MsgBox(MyVersion)
If NewVersion <> "" Then If NewVersion <> "" Then
<<<<<<< HEAD
If NewVersion <> MyVersion Then If NewVersion <> MyVersion Then
=======
Dim shortMyversion As Long
Dim shortNewVersion As Long
shortMyversion = ShortVersion(MyVersion)
shortNewVersion = ShortVersion(NewVersion)
If shortNewVersion > shortMyversion Then
MsgBox("InventorAddIn插件" & vbCrLf & "当前版本:" & MyVersion & vbCrLf & "检查到 新版本:" & NewVersion, MsgBoxStyle.OkOnly, " 检查更新")
>>>>>>> c3706ff (新增重新BOM序号与排序)
simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe" simupdate = My.Application.Info.DirectoryPath & "\simupdater.exe"
Process.Start(simupdate) Process.Start(simupdate)
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
<<<<<<< HEAD
MsgBox(ex.Message) MsgBox(ex.Message)
End Try End Try
...@@ -64,4 +80,19 @@ Module NewUpdater ...@@ -64,4 +80,19 @@ Module NewUpdater
End Sub End Sub
=======
'MsgBox(ex.Message)
End Try
End Sub
Public Function ShortVersion(ByVal LongVesion As String) As Long
ShortVersion = Val(Strings.Replace(LongVesion, ".", ""))
Return ShortVersion
End Function
>>>>>>> c3706ff (新增重新BOM序号与排序)
End Module End Module
编辑:leaky
修改日期:2021-6-28
此项目为Inventor插件,支持到2015版本。
1.21.7.13
[+]新增批量打印功能:【设置】【批量打印工程图】
[+]新增在线升级功能:【关于】【检查更新】
1.21.7.22
[+]新增批量打印时导入已打开工程图文档:【设置】【批量打印工程图】【导入已打开文档】
1.21.8.27
[+]增加相关菜单图标
[+]修正批量打印保存工程图
\ No newline at end of file
编辑:leaky
修改日期:2021-6-28
此项目为Inventor插件,支持到2015版本。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册