From 2b2c1d3f6789a14fa8f32e6fe77f550e88fabeb6 Mon Sep 17 00:00:00 2001 From: leaky114 Date: Tue, 19 Oct 2021 16:47:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=8D=E6=96=B0BOM?= =?UTF-8?q?=E5=BA=8F=E5=8F=B7=E4=B8=8E=E6=8E=92=E5=BA=8F=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=83=A8=E5=88=86=E5=9B=BE=E6=A0=87=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3BOM=E5=AF=BC=E5=87=BA=E9=A1=B9=E7=9B=AE=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E8=8F=9C=E5=8D=95=E6=97=A0=E6=88=90=E6=9C=AC=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=80=89=E9=A1=B9=20=E4=BF=AE=E6=94=B9=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E8=BE=93=E5=85=A5=E6=A1=86=E7=BB=86=E8=8A=82=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=AF=E5=8A=A8=E6=A3=80=E6=9F=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=AE=BE=E7=BD=AE=E3=80=90=E8=AE=BE=E7=BD=AE=E3=80=91?= =?UTF-8?q?=E3=80=90=E5=90=AF=E5=8A=A8=E6=97=B6=E6=A3=80=E6=9F=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=80=91=20=E5=8F=96=E6=B6=88=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=90=8E=E5=85=B3=E9=97=AD=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AssemblyInfo.vb | 4 +-- Form/About.vb | 17 +++++++----- Form/ChangeIpro.Designer.vb | 3 ++- Form/ChangeIpro.vb | 10 ++++--- Form/InventoryCoding.vb | 2 ++ Form/OptionDialog.Designer.vb | 18 ++++++++++++- Form/OptionDialog.vb | 28 +++++++++++++++++--- Form/PrintIPWDialog.Designer.vb | 1 + Form/PrintIPWDialog.vb | 11 ++++++-- Module/Inventorbasic.vb | 45 ++++++++++++++++---------------- Module/NewUpdater.vb | 31 ++++++++++++++++++++++ ReadMe.MD | 13 +++++++++ ReadMe.txt | 4 --- obj/Release/Interop.Office.dll | Bin 442368 -> 442368 bytes obj/Release/Interop.VBIDE.dll | Bin 57344 -> 57344 bytes 15 files changed, 141 insertions(+), 46 deletions(-) create mode 100644 ReadMe.MD delete mode 100644 ReadMe.txt diff --git a/AssemblyInfo.vb b/AssemblyInfo.vb index d84acb3..d34669e 100644 --- a/AssemblyInfo.vb +++ b/AssemblyInfo.vb @@ -28,5 +28,5 @@ Imports System.Runtime.InteropServices ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: - - \ No newline at end of file + + \ No newline at end of file diff --git a/Form/About.vb b/Form/About.vb index 4868922..e31569d 100644 --- a/Form/About.vb +++ b/Form/About.vb @@ -27,13 +27,16 @@ Public NotInheritable Class About End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click - Try - Dim simupdate As String + 'Try + ' 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 Class diff --git a/Form/ChangeIpro.Designer.vb b/Form/ChangeIpro.Designer.vb index 4144539..710d86b 100644 --- a/Form/ChangeIpro.Designer.vb +++ b/Form/ChangeIpro.Designer.vb @@ -75,7 +75,7 @@ Partial Class ChangeIproDialog Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(65, 60) 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 ' @@ -83,6 +83,7 @@ Partial Class ChangeIproDialog Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(164, 21) Me.TextBox1.TabIndex = 2 + Me.TextBox1.WordWrap = False ' 'TextBox2 ' diff --git a/Form/ChangeIpro.vb b/Form/ChangeIpro.vb index a3dcf85..bf6f6bf 100644 --- a/Form/ChangeIpro.vb +++ b/Form/ChangeIpro.vb @@ -7,8 +7,8 @@ Public Class ChangeIproDialog Dim InventorDoc As Document InventorDoc = ThisApplication.ActiveEditDocument - SetPropitem(InventorDoc, "零件代号", TextBox1.Text) - SetPropitem(InventorDoc, "库存编号", TextBox2.Text) + SetPropitem(InventorDoc, Map_StochNum, TextBox1.Text) + SetPropitem(InventorDoc, Map_PartName, TextBox2.Text) SetPropitem(InventorDoc, "描述", TextBox3.Text) Me.DialogResult = System.Windows.Forms.DialogResult.OK @@ -35,9 +35,9 @@ Public Class ChangeIproDialog Dim StockNumPartName As StockNumPartName = Nothing For Each propitem In oPropSet Select Case propitem.DisplayName - Case "零件代号" + Case Map_StochNum TextBox1.Text = propitem.Value - Case "库存编号" + Case Map_PartName TextBox2.Text = propitem.Value Case "描述" TextBox3.Text = propitem.Value @@ -59,4 +59,6 @@ Public Class ChangeIproDialog TextBox2.Text = TextBox3.Text TextBox3.Text = Str_TempText End Sub + + End Class diff --git a/Form/InventoryCoding.vb b/Form/InventoryCoding.vb index 81b5a4f..ca64160 100644 --- a/Form/InventoryCoding.vb +++ b/Form/InventoryCoding.vb @@ -74,6 +74,8 @@ Public Class InventoryCoding If opfile.FileName <> "" Then '如果有选中文件 ExcelFullFileName = opfile.FileName End If + Else + Exit Sub End If If Lead_InventoryCoding(ExcelFullFileName, ListView1) Then diff --git a/Form/OptionDialog.Designer.vb b/Form/OptionDialog.Designer.vb index 66532f2..ab8f0b0 100644 --- a/Form/OptionDialog.Designer.vb +++ b/Form/OptionDialog.Designer.vb @@ -64,6 +64,7 @@ Partial Class OptionDialog Me.CheckBox4 = New System.Windows.Forms.CheckBox Me.TextBox7 = New System.Windows.Forms.TextBox Me.Label11 = New System.Windows.Forms.Label + Me.CheckBox5 = New System.Windows.Forms.CheckBox Me.TableLayoutPanel1.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() @@ -339,7 +340,7 @@ Partial Class OptionDialog ' Me.ComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList 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.Name = "ComboBox3" Me.ComboBox3.Size = New System.Drawing.Size(170, 20) @@ -491,6 +492,18 @@ Partial Class OptionDialog Me.Label11.TabIndex = 4 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 ' Me.AcceptButton = Me.OK_Button @@ -498,6 +511,7 @@ Partial Class OptionDialog Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.CancelButton = Me.Cancel_Button Me.ClientSize = New System.Drawing.Size(533, 458) + Me.Controls.Add(Me.CheckBox5) Me.Controls.Add(Me.GroupBox7) Me.Controls.Add(Me.GroupBox6) Me.Controls.Add(Me.GroupBox5) @@ -529,6 +543,7 @@ Partial Class OptionDialog Me.GroupBox7.ResumeLayout(False) Me.GroupBox7.PerformLayout() Me.ResumeLayout(False) + Me.PerformLayout() End Sub Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel @@ -573,5 +588,6 @@ Partial Class OptionDialog Friend WithEvents Label11 As System.Windows.Forms.Label Friend WithEvents ComboBox6 As System.Windows.Forms.ComboBox Friend WithEvents Label12 As System.Windows.Forms.Label + Friend WithEvents CheckBox5 As System.Windows.Forms.CheckBox End Class diff --git a/Form/OptionDialog.vb b/Form/OptionDialog.vb index a838f40..de566d2 100644 --- a/Form/OptionDialog.vb +++ b/Form/OptionDialog.vb @@ -35,7 +35,7 @@ Public Class OptionDialog Case CheckState.Unchecked IsDayAndName = -1 Case CheckState.Indeterminate - IsDayAndName = 0S + IsDayAndName = 0 Case CheckState.Checked IsDayAndName = 1 End Select @@ -45,7 +45,7 @@ Public Class OptionDialog Case CheckState.Unchecked IsSetDrawingScale = -1 Case CheckState.Indeterminate - IsSetDrawingScale = 0S + IsSetDrawingScale = 0 Case CheckState.Checked IsSetDrawingScale = 1 End Select @@ -55,11 +55,22 @@ Public Class OptionDialog Case CheckState.Unchecked IsSetMass = -1 Case CheckState.Indeterminate - IsSetMass = 0S + IsSetMass = 0 Case CheckState.Checked IsSetMass = 1 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 Case "", "0" @@ -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", "Area_Accuracy", Area_Accuracy) + My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\InventorTool", "CheckUpdate", CheckUpdate) + Me.DialogResult = System.Windows.Forms.DialogResult.OK Me.Close() End Sub @@ -205,6 +218,15 @@ Public Class OptionDialog CheckBox4.CheckState = CheckState.Checked 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 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button添加.Click diff --git a/Form/PrintIPWDialog.Designer.vb b/Form/PrintIPWDialog.Designer.vb index f5f373a..69b3f82 100644 --- a/Form/PrintIPWDialog.Designer.vb +++ b/Form/PrintIPWDialog.Designer.vb @@ -235,6 +235,7 @@ Partial Class PrintIPWDialog Me.ListView1.Location = New System.Drawing.Point(15, 11) Me.ListView1.Name = "ListView1" Me.ListView1.Size = New System.Drawing.Size(670, 314) + Me.ListView1.Sorting = System.Windows.Forms.SortOrder.Ascending Me.ListView1.TabIndex = 36 Me.ListView1.UseCompatibleStateImageBehavior = False Me.ListView1.View = System.Windows.Forms.View.Details diff --git a/Form/PrintIPWDialog.vb b/Form/PrintIPWDialog.vb index fdeffe3..288335a 100644 --- a/Form/PrintIPWDialog.vb +++ b/Form/PrintIPWDialog.vb @@ -46,12 +46,15 @@ Public Class PrintIPWDialog 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) - IdwDoc.Close(True) + 'IdwDoc.Close(False) 999: Next @@ -209,6 +212,8 @@ Public Class PrintIPWDialog .Orientation = PrintOrientationEnum.kPortraitOrientation End Select + + ' Set to print all sheets. .PrintRange = PrintRangeEnum.kPrintAllSheets @@ -320,4 +325,6 @@ Public Class PrintIPWDialog MsgBox(ex.Message) End Try End Sub + + End Class diff --git a/Module/Inventorbasic.vb b/Module/Inventorbasic.vb index 9c01d77..8231a24 100644 --- a/Module/Inventorbasic.vb +++ b/Module/Inventorbasic.vb @@ -62,6 +62,8 @@ Module InventorBasic Public IsSetMass As Short '打开工程图时是否写 质量 到ipro 是赋值为1 + Public CheckUpdate As Short '启动检查更新 + Public TotalItem As Integer 'BOM序号 Public OPosition(9) As Point '点 @@ -2159,29 +2161,17 @@ Module InventorBasic End Sub - '保存文件时的事件 - Public Sub ThisApplicationEvents_OnOnSaveDocument(ByVal DocumentObject As Inventor._Document, _ - ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ - ByVal Context As Inventor.NameValueMap, _ - ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles ThisApplicationEvents.OnSaveDocument + 'Public Sub ThisApplicationEvents_OnOnSaveDocument(ByVal DocumentObject As Inventor._Document, _ + ' ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ + ' ByVal Context As Inventor.NameValueMap, _ + ' 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, _ @@ -2204,13 +2194,24 @@ Module InventorBasic End Sub '激活一个文档时的事件 - 'Public Sub ThisApplicationEvents_OnActivateDocument(ByVal DocumentObject As Inventor._Document, _ - ' ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ - ' ByVal Context As Inventor.NameValueMap, _ - ' ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles ThisApplicationEvents.OnActivateDocument + Public Sub ThisApplicationEvents_OnActivateDocument(ByVal DocumentObject As Inventor._Document, _ + ByVal BeforeOrAfter As Inventor.EventTimingEnum, _ + ByVal Context As Inventor.NameValueMap, _ + 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 diff --git a/Module/NewUpdater.vb b/Module/NewUpdater.vb index 6a4f0ca..1571ade 100644 --- a/Module/NewUpdater.vb +++ b/Module/NewUpdater.vb @@ -25,7 +25,11 @@ Module NewUpdater Catch ex As Exception +<<<<<<< HEAD MsgBox(ex.Message) +======= + 'MsgBox(ex.Message) +>>>>>>> c3706ff (新增重新BOM序号与排序) End Try End Sub @@ -49,14 +53,26 @@ Module NewUpdater 'MsgBox(MyVersion) If NewVersion <> "" Then +<<<<<<< HEAD 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" Process.Start(simupdate) End If End If Catch ex As Exception +<<<<<<< HEAD MsgBox(ex.Message) End Try @@ -64,4 +80,19 @@ Module NewUpdater 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 diff --git a/ReadMe.MD b/ReadMe.MD new file mode 100644 index 0000000..bdc3549 --- /dev/null +++ b/ReadMe.MD @@ -0,0 +1,13 @@ +༭leaky +޸ڣ2021-6-28 + + ĿΪInventorֵ֧2015汾 + + 1.21.7.13 +[+]ӡܣáӡͼ +[+]ܣڡ¡ +1.21.7.22 +[+]ӡʱѴ򿪹ͼĵáӡͼѴĵ +1.21.8.27 +[+]ز˵ͼ +[+]ӡ湤ͼ \ No newline at end of file diff --git a/ReadMe.txt b/ReadMe.txt deleted file mode 100644 index 022a9da..0000000 --- a/ReadMe.txt +++ /dev/null @@ -1,4 +0,0 @@ -༭leaky -޸ڣ2021-6-28 - - ĿΪInventorֵ֧2015汾 \ No newline at end of file diff --git a/obj/Release/Interop.Office.dll b/obj/Release/Interop.Office.dll index cf77daea1e47ce444b7dcd836bfa314ad99bc8a8..657156c4332fcd22bafa2fcc5a2fe95cb4145504 100644 GIT binary patch delta 57 zcmV-90LK4-fE$2-8<23_@dWk|Wn PJb0Kcmf*L@AO<*}tXvpL delta 57 zcmZo@kZx#@p3uR(ujo-@cWXCeYd2GCH*;$@OKUgl)^0Xk1%adsoLuuwwA^;&WaV!y NwAi%$gaVtzd;pc}7J~o) diff --git a/obj/Release/Interop.VBIDE.dll b/obj/Release/Interop.VBIDE.dll index ac7b63143615b7cd6efeaf9862e33665619c981a..ac70b6dadc907bf221dab202510716ea9639748b 100644 GIT binary patch delta 38 wcmV+>0NMY5zypB51CWRVP^SN}i`|+KRC_g&?xy)kh^D08KN2;Fvv`|`L~!~O761SM delta 38 wcmV+>0NMY5zypB51CWRVzH;KRi`|+K58tjR@%&&&gw%9pkL9Q-vv`|`M0#oy*Z=?k -- GitLab