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

更新到2023.6.28版

上级 b4cffd34

\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmERPCodeSearch
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btn粘贴 = New System.Windows.Forms.Button()
Me.btn编码反查 = New System.Windows.Forms.Button()
Me.lblERP编码 = New System.Windows.Forms.Label()
Me.btn关闭 = New System.Windows.Forms.Button()
Me.txtERP编码 = New System.Windows.Forms.TextBox()
Me.txt返回值 = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'btn粘贴
'
Me.btn粘贴.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn粘贴.Location = New System.Drawing.Point(257, 10)
Me.btn粘贴.Name = "btn粘贴"
Me.btn粘贴.Size = New System.Drawing.Size(81, 28)
Me.btn粘贴.TabIndex = 10
Me.btn粘贴.Text = "粘贴"
Me.btn粘贴.UseVisualStyleBackColor = True
'
'btn编码反查
'
Me.btn编码反查.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn编码反查.Location = New System.Drawing.Point(186, 54)
Me.btn编码反查.Name = "btn编码反查"
Me.btn编码反查.Size = New System.Drawing.Size(81, 28)
Me.btn编码反查.TabIndex = 11
Me.btn编码反查.Text = "编码反查"
'
'lblERP编码
'
Me.lblERP编码.AutoSize = True
Me.lblERP编码.Location = New System.Drawing.Point(9, 16)
Me.lblERP编码.Name = "lblERP编码"
Me.lblERP编码.Size = New System.Drawing.Size(59, 12)
Me.lblERP编码.TabIndex = 14
Me.lblERP编码.Text = "ERP编码:"
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(273, 54)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(65, 28)
Me.btn关闭.TabIndex = 12
Me.btn关闭.Text = "关闭"
'
'txtERP编码
'
Me.txtERP编码.Location = New System.Drawing.Point(82, 12)
Me.txtERP编码.Name = "txtERP编码"
Me.txtERP编码.Size = New System.Drawing.Size(164, 21)
Me.txtERP编码.TabIndex = 0
'
'txt返回值
'
Me.txt返回值.Location = New System.Drawing.Point(17, 97)
Me.txt返回值.Multiline = True
Me.txt返回值.Name = "txt返回值"
Me.txt返回值.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.txt返回值.Size = New System.Drawing.Size(320, 131)
Me.txt返回值.TabIndex = 15
'
'frmERPCodeSearch
'
Me.AcceptButton = Me.btn编码反查
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn关闭
Me.ClientSize = New System.Drawing.Size(350, 240)
Me.Controls.Add(Me.txt返回值)
Me.Controls.Add(Me.btn粘贴)
Me.Controls.Add(Me.btn编码反查)
Me.Controls.Add(Me.lblERP编码)
Me.Controls.Add(Me.btn关闭)
Me.Controls.Add(Me.txtERP编码)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmERPCodeSearch"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "ERP编码反查"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btn粘贴 As System.Windows.Forms.Button
Friend WithEvents btn编码反查 As System.Windows.Forms.Button
Friend WithEvents lblERP编码 As System.Windows.Forms.Label
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents txtERP编码 As System.Windows.Forms.TextBox
Friend WithEvents txt返回值 As System.Windows.Forms.TextBox
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
Imports System.Windows.Forms
Public Class frmERPCodeSearch
Private Sub btn粘贴_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn粘贴.Click
txtERP编码.Text = My.Computer.Clipboard.GetText
End Sub
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
Private Sub btn编码反查_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn编码反查.Click
Dim strERPCode As String
btn编码反查.Enabled = False
Me.Height = 124
txt返回值.Clear()
strERPCode = Replace(txtERP编码.Text, vbCrLf, "")
strERPCode = Trim(strERPCode)
If strERPCode = "" Then
btn编码反查.Enabled = True
Exit Sub
End If
Dim arraystrinfo() As String
arraystrinfo = ERPCodeSearch(BasicExcelFullFileName, strERPCode, TableArrays, ColIndexNum, 0)
If arraystrinfo(0) Is Nothing Then
txt返回值.Text = "未查询到ERP编码。"
Me.Height = 280
btn编码反查.Enabled = True
Exit Sub
End If
For Each strinfo As String In arraystrinfo
If txt返回值.Text = "" Then
txt返回值.Text = strinfo
Else
If strinfo Is Nothing Then
Else
txt返回值.Text = txt返回值.Text & vbCrLf & strinfo
End If
End If
Next
'oInteraction.Stop()
Me.Height = 280
btn编码反查.Enabled = True
End Sub
Private Sub txtERP编码_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtERP编码.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
btn编码反查.PerformClick()
End If
End Sub
Private Sub frmERPCodeSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Height = 124
End Sub
End Class
\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmImportCodeToBomExcel
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btn确定 = New System.Windows.Forms.Button()
Me.btn关闭 = New System.Windows.Forms.Button()
Me.txt最后行 = New System.Windows.Forms.TextBox()
Me.cmb查找列 = New System.Windows.Forms.ComboBox()
Me.cmb写入列 = New System.Windows.Forms.ComboBox()
Me.lbl最后行 = New System.Windows.Forms.Label()
Me.lbl查找列 = New System.Windows.Forms.Label()
Me.lbl写入列 = New System.Windows.Forms.Label()
Me.txtExcel文件 = New System.Windows.Forms.TextBox()
Me.btn打开excel文件 = New System.Windows.Forms.Button()
Me.prgProcess = New System.Windows.Forms.ProgressBar()
Me.SuspendLayout()
'
'btn确定
'
Me.btn确定.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn确定.Location = New System.Drawing.Point(351, 97)
Me.btn确定.Name = "btn确定"
Me.btn确定.Size = New System.Drawing.Size(65, 28)
Me.btn确定.TabIndex = 12
Me.btn确定.Text = "确定"
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(426, 97)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(65, 28)
Me.btn关闭.TabIndex = 11
Me.btn关闭.Text = "关闭"
'
'txt最后行
'
Me.txt最后行.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.txt最后行.Location = New System.Drawing.Point(12, 19)
Me.txt最后行.Name = "txt最后行"
Me.txt最后行.Size = New System.Drawing.Size(44, 21)
Me.txt最后行.TabIndex = 14
Me.txt最后行.Text = "100"
'
'cmb查找列
'
Me.cmb查找列.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.cmb查找列.FormattingEnabled = True
Me.cmb查找列.Items.AddRange(New Object() {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"})
Me.cmb查找列.Location = New System.Drawing.Point(177, 19)
Me.cmb查找列.Name = "cmb查找列"
Me.cmb查找列.Size = New System.Drawing.Size(46, 20)
Me.cmb查找列.Sorted = True
Me.cmb查找列.TabIndex = 15
Me.cmb查找列.Text = "B"
'
'cmb写入列
'
Me.cmb写入列.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.cmb写入列.FormattingEnabled = True
Me.cmb写入列.Items.AddRange(New Object() {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"})
Me.cmb写入列.Location = New System.Drawing.Point(323, 19)
Me.cmb写入列.Name = "cmb写入列"
Me.cmb写入列.Size = New System.Drawing.Size(46, 20)
Me.cmb写入列.Sorted = True
Me.cmb写入列.TabIndex = 16
Me.cmb写入列.Text = "C"
'
'lbl最后行
'
Me.lbl最后行.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lbl最后行.AutoSize = True
Me.lbl最后行.Location = New System.Drawing.Point(62, 24)
Me.lbl最后行.Name = "lbl最后行"
Me.lbl最后行.Size = New System.Drawing.Size(41, 12)
Me.lbl最后行.TabIndex = 17
Me.lbl最后行.Text = "最后行"
'
'lbl查找列
'
Me.lbl查找列.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lbl查找列.AutoSize = True
Me.lbl查找列.Location = New System.Drawing.Point(130, 24)
Me.lbl查找列.Name = "lbl查找列"
Me.lbl查找列.Size = New System.Drawing.Size(41, 12)
Me.lbl查找列.TabIndex = 18
Me.lbl查找列.Text = "查找列"
'
'lbl写入列
'
Me.lbl写入列.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lbl写入列.AutoSize = True
Me.lbl写入列.Location = New System.Drawing.Point(276, 24)
Me.lbl写入列.Name = "lbl写入列"
Me.lbl写入列.Size = New System.Drawing.Size(41, 12)
Me.lbl写入列.TabIndex = 19
Me.lbl写入列.Text = "写入列"
'
'txtExcel文件
'
Me.txtExcel文件.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.txtExcel文件.Location = New System.Drawing.Point(12, 55)
Me.txtExcel文件.Name = "txtExcel文件"
Me.txtExcel文件.Size = New System.Drawing.Size(402, 21)
Me.txtExcel文件.TabIndex = 20
Me.txtExcel文件.Text = "选择Bom表Excel文件"
'
'btn打开excel文件
'
Me.btn打开excel文件.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn打开excel文件.Location = New System.Drawing.Point(425, 54)
Me.btn打开excel文件.Name = "btn打开excel文件"
Me.btn打开excel文件.Size = New System.Drawing.Size(49, 25)
Me.btn打开excel文件.TabIndex = 21
Me.btn打开excel文件.Text = "打开"
Me.btn打开excel文件.UseVisualStyleBackColor = True
'
'prgProcess
'
Me.prgProcess.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.prgProcess.Location = New System.Drawing.Point(12, 100)
Me.prgProcess.Name = "prgProcess"
Me.prgProcess.Size = New System.Drawing.Size(312, 22)
Me.prgProcess.Style = System.Windows.Forms.ProgressBarStyle.Continuous
Me.prgProcess.TabIndex = 22
'
'frmImportCodeToBomExcel
'
Me.AcceptButton = Me.btn确定
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn关闭
Me.ClientSize = New System.Drawing.Size(503, 139)
Me.Controls.Add(Me.prgProcess)
Me.Controls.Add(Me.btn打开excel文件)
Me.Controls.Add(Me.txtExcel文件)
Me.Controls.Add(Me.lbl写入列)
Me.Controls.Add(Me.lbl查找列)
Me.Controls.Add(Me.lbl最后行)
Me.Controls.Add(Me.cmb写入列)
Me.Controls.Add(Me.cmb查找列)
Me.Controls.Add(Me.txt最后行)
Me.Controls.Add(Me.btn确定)
Me.Controls.Add(Me.btn关闭)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmImportCodeToBomExcel"
Me.Padding = New System.Windows.Forms.Padding(9, 8, 9, 8)
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "导入ERP编码到Bom表"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btn确定 As System.Windows.Forms.Button
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents txt最后行 As System.Windows.Forms.TextBox
Friend WithEvents cmb查找列 As System.Windows.Forms.ComboBox
Friend WithEvents cmb写入列 As System.Windows.Forms.ComboBox
Friend WithEvents lbl最后行 As System.Windows.Forms.Label
Friend WithEvents lbl查找列 As System.Windows.Forms.Label
Friend WithEvents lbl写入列 As System.Windows.Forms.Label
Friend WithEvents txtExcel文件 As System.Windows.Forms.TextBox
Friend WithEvents btn打开excel文件 As System.Windows.Forms.Button
Friend WithEvents prgProcess As System.Windows.Forms.ProgressBar
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
Imports Microsoft.Office.Interop
Imports System.Windows.Forms
Public NotInheritable Class frmImportCodeToBomExcel
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
Private Sub 确定_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn确定.Click
On Error Resume Next
Dim strBomExcelFile As String
Dim intLastLine As Integer
Dim strDataColumn As String
Dim strReturnColumn As String
strBomExcelFile = txtExcel文件.Text
If IsFileExsts(strBomExcelFile) = False Then
MsgBox("BOM文件错误!", MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "导入ERP编码")
Exit Sub
End If
btn确定.Enabled = False
'ThisApplication.Cursor = Cursors.WaitCursor
intLastLine = txt最后行.Text
strDataColumn = cmb查找列.Text
strReturnColumn = cmb写入列.Text
Dim oExcelApplication As Excel.Application
oExcelApplication = New Excel.Application
oExcelApplication.Visible = False
'bom表文件
Dim oBOMWorkbook As Excel.Workbook = oExcelApplication.Workbooks.Open(strBomExcelFile)
Dim oBOMWorksheet As Excel.Worksheet = Nothing
Dim oBOMRange As Excel.Range = Nothing
'数据库文件
Dim oExcelWorkbook As Excel.Workbook = oExcelApplication.Workbooks.Open(BasicExcelFullFileName)
Dim oExcelWorksheet As Excel.Worksheet = Nothing
Dim oExcelRange As Excel.Range = Nothing
Dim strRangeName As String
Dim strDrawingNo As String
Dim strERPCode As String = Nothing
Dim Table_Array(10) As String
Table_Array = Split(TableArrays, ",")
For Each oBOMWorksheet In oBOMWorkbook.Sheets
prgProcess.Minimum = 0
prgProcess.Maximum = intLastLine
For i = 1 To intLastLine
prgProcess.Value = i
strERPCode = ""
strRangeName = strDataColumn & i
oBOMRange = oBOMWorksheet.Range(strRangeName)
strDrawingNo = oBOMRange.Text.ToString
Debug.Print(strDrawingNo)
For Each oExcelWorksheet In oExcelWorkbook.Sheets
Dim intMatchRow As Integer = Nothing
Dim strFindRowValue As String = Nothing
For Each a In Table_Array
oExcelRange = oExcelWorksheet.Range(a & ":" & a)
intMatchRow = oExcelApplication.WorksheetFunction.Match(strDrawingNo, oExcelRange, 0)
If intMatchRow <> 0 Then
Exit For
End If
Next
If intMatchRow <> 0 Then
Dim strFindRow As String
strFindRow = ColIndexNum & intMatchRow
strERPCode = oExcelWorksheet.Range(strFindRow).Value
Else
strERPCode = ""
End If
Next
Debug.Print(strERPCode)
If strERPCode <> "" Then
strRangeName = strReturnColumn & i
oBOMRange = oBOMWorksheet.Range(strRangeName)
oBOMRange.Value = strERPCode
End If
Next
Next
oBOMWorkbook.Save()
'关闭文件
oBOMWorkbook.Close()
oExcelWorkbook.Close()
' 8.退出Excel程序
oExcelApplication.Quit()
'9.释放资源
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcelRange)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oBOMRange)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oBOMWorksheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcelWorksheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oBOMWorkbook)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcelApplication)
'10.调用GC的垃圾收集方法
GC.Collect()
GC.WaitForPendingFinalizers()
MsgBox("写入ERP编码完成!", MsgBoxStyle.OkOnly, "导入ERP编码")
btn确定.Enabled = True
Process.Start(strBomExcelFile)
End Sub
Private Sub btn打开excel文件_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn打开excel文件.Click
Dim oOpenFileDialog As New OpenFileDialog
With oOpenFileDialog
.Title = "打开"
.FileName = ""
.InitialDirectory = System.Environment.SpecialFolder.Desktop
.Filter = "Excel 工作薄(*.xlsx;*.xls)|*.xlsx;*.xls" '添加过滤文件
.Multiselect = False '多开文件打开
If .ShowDialog = System.Windows.Forms.DialogResult.OK Then '如果打开窗口OK
If .FileName <> "" Then '如果有选中文件
txtExcel文件.Text = .FileName
End If
Else
Exit Sub
End If
End With
End Sub
Private Sub frmImportCodeToBomExcel_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class
\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmImportCodeToIam
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.lvw文件列表 = New System.Windows.Forms.ListView()
Me.ch图号 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch名称 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch编码 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch供应商 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch文件名 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ContextMenuStrip右键菜单 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ToolStrip设置为标准件 = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStrip设置为看板件 = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStrip设置为外购件 = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStrip设置为外协件 = New System.Windows.Forms.ToolStripMenuItem()
Me.btn关闭 = New System.Windows.Forms.Button()
Me.btn查询 = New System.Windows.Forms.Button()
Me.btn写入 = New System.Windows.Forms.Button()
Me.prg进度条 = New System.Windows.Forms.ProgressBar()
Me.btn装载 = New System.Windows.Forms.Button()
Me.chk展开子级 = New System.Windows.Forms.CheckBox()
Me.chk提示选择 = New System.Windows.Forms.CheckBox()
Me.chk展开外协 = New System.Windows.Forms.CheckBox()
Me.ContextMenuStrip右键菜单.SuspendLayout()
Me.SuspendLayout()
'
'lvw文件列表
'
Me.lvw文件列表.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvw文件列表.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ch图号, Me.ch名称, Me.ch编码, Me.ch供应商, Me.ch文件名})
Me.lvw文件列表.ContextMenuStrip = Me.ContextMenuStrip右键菜单
Me.lvw文件列表.FullRowSelect = True
Me.lvw文件列表.Location = New System.Drawing.Point(12, 12)
Me.lvw文件列表.MultiSelect = False
Me.lvw文件列表.Name = "lvw文件列表"
Me.lvw文件列表.Size = New System.Drawing.Size(799, 357)
Me.lvw文件列表.Sorting = System.Windows.Forms.SortOrder.Ascending
Me.lvw文件列表.TabIndex = 0
Me.lvw文件列表.UseCompatibleStateImageBehavior = False
Me.lvw文件列表.View = System.Windows.Forms.View.Details
'
'ch图号
'
Me.ch图号.Text = "规格(图号)"
Me.ch图号.Width = 200
'
'ch名称
'
Me.ch名称.Text = "存货名称"
Me.ch名称.Width = 146
'
'ch编码
'
Me.ch编码.Text = "存货编码"
Me.ch编码.Width = 70
'
'ch供应商
'
Me.ch供应商.Text = "供应商"
'
'ch文件名
'
Me.ch文件名.Text = "文件(双击打开)"
Me.ch文件名.Width = 250
'
'ContextMenuStrip右键菜单
'
Me.ContextMenuStrip右键菜单.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStrip设置为标准件, Me.ToolStrip设置为看板件, Me.ToolStrip设置为外购件, Me.ToolStrip设置为外协件})
Me.ContextMenuStrip右键菜单.Name = "ContextMenuStrip1"
Me.ContextMenuStrip右键菜单.Size = New System.Drawing.Size(149, 92)
'
'ToolStrip设置为标准件
'
Me.ToolStrip设置为标准件.Name = "ToolStrip设置为标准件"
Me.ToolStrip设置为标准件.Size = New System.Drawing.Size(148, 22)
Me.ToolStrip设置为标准件.Text = "设置为标准件"
'
'ToolStrip设置为看板件
'
Me.ToolStrip设置为看板件.Name = "ToolStrip设置为看板件"
Me.ToolStrip设置为看板件.Size = New System.Drawing.Size(148, 22)
Me.ToolStrip设置为看板件.Text = "设置为看板件"
'
'ToolStrip设置为外购件
'
Me.ToolStrip设置为外购件.Name = "ToolStrip设置为外购件"
Me.ToolStrip设置为外购件.Size = New System.Drawing.Size(148, 22)
Me.ToolStrip设置为外购件.Text = "设置为外购件"
'
'ToolStrip设置为外协件
'
Me.ToolStrip设置为外协件.Name = "ToolStrip设置为外协件"
Me.ToolStrip设置为外协件.Size = New System.Drawing.Size(148, 22)
Me.ToolStrip设置为外协件.Text = "设置为外协件"
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.AutoSize = True
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(740, 386)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(69, 28)
Me.btn关闭.TabIndex = 32
Me.btn关闭.Text = "关闭"
'
'btn查询
'
Me.btn查询.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn查询.Location = New System.Drawing.Point(586, 386)
Me.btn查询.Name = "btn查询"
Me.btn查询.Size = New System.Drawing.Size(69, 28)
Me.btn查询.TabIndex = 31
Me.btn查询.Text = "查询"
'
'btn写入
'
Me.btn写入.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn写入.Location = New System.Drawing.Point(663, 386)
Me.btn写入.Name = "btn写入"
Me.btn写入.Size = New System.Drawing.Size(69, 28)
Me.btn写入.TabIndex = 34
Me.btn写入.Text = "写入"
Me.btn写入.UseVisualStyleBackColor = True
'
'prg进度条
'
Me.prg进度条.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.prg进度条.Location = New System.Drawing.Point(12, 389)
Me.prg进度条.Name = "prg进度条"
Me.prg进度条.Size = New System.Drawing.Size(243, 24)
Me.prg进度条.Style = System.Windows.Forms.ProgressBarStyle.Continuous
Me.prg进度条.TabIndex = 35
'
'btn装载
'
Me.btn装载.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn装载.Location = New System.Drawing.Point(509, 386)
Me.btn装载.Name = "btn装载"
Me.btn装载.Size = New System.Drawing.Size(69, 28)
Me.btn装载.TabIndex = 36
Me.btn装载.Text = "装载"
'
'chk展开子级
'
Me.chk展开子级.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.chk展开子级.AutoSize = True
Me.chk展开子级.Location = New System.Drawing.Point(429, 392)
Me.chk展开子级.Name = "chk展开子级"
Me.chk展开子级.Size = New System.Drawing.Size(72, 16)
Me.chk展开子级.TabIndex = 38
Me.chk展开子级.Text = "展开子级"
Me.chk展开子级.UseVisualStyleBackColor = True
'
'chk提示选择
'
Me.chk提示选择.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.chk提示选择.AutoSize = True
Me.chk提示选择.Location = New System.Drawing.Point(264, 392)
Me.chk提示选择.Name = "chk提示选择"
Me.chk提示选择.Size = New System.Drawing.Size(72, 16)
Me.chk提示选择.TabIndex = 39
Me.chk提示选择.Text = "提示选择"
Me.chk提示选择.UseVisualStyleBackColor = True
'
'chk展开外协
'
Me.chk展开外协.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.chk展开外协.AutoSize = True
Me.chk展开外协.Location = New System.Drawing.Point(346, 392)
Me.chk展开外协.Name = "chk展开外协"
Me.chk展开外协.Size = New System.Drawing.Size(72, 16)
Me.chk展开外协.TabIndex = 40
Me.chk展开外协.Text = "展开外协"
Me.chk展开外协.UseVisualStyleBackColor = True
'
'frmImportCodeToIam
'
Me.AcceptButton = Me.btn装载
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn关闭
Me.ClientSize = New System.Drawing.Size(823, 425)
Me.Controls.Add(Me.chk展开外协)
Me.Controls.Add(Me.chk提示选择)
Me.Controls.Add(Me.chk展开子级)
Me.Controls.Add(Me.btn装载)
Me.Controls.Add(Me.prg进度条)
Me.Controls.Add(Me.btn写入)
Me.Controls.Add(Me.btn关闭)
Me.Controls.Add(Me.btn查询)
Me.Controls.Add(Me.lvw文件列表)
Me.MaximizeBox = False
Me.Name = "frmImportCodeToIam"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "导入ERP编码"
Me.TopMost = True
Me.ContextMenuStrip右键菜单.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents lvw文件列表 As System.Windows.Forms.ListView
Friend WithEvents ch编码 As System.Windows.Forms.ColumnHeader
Friend WithEvents ch名称 As System.Windows.Forms.ColumnHeader
Friend WithEvents ch图号 As System.Windows.Forms.ColumnHeader
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents btn查询 As System.Windows.Forms.Button
Friend WithEvents ch文件名 As System.Windows.Forms.ColumnHeader
Friend WithEvents btn写入 As System.Windows.Forms.Button
Friend WithEvents prg进度条 As System.Windows.Forms.ProgressBar
Friend WithEvents btn装载 As System.Windows.Forms.Button
Friend WithEvents chk展开子级 As System.Windows.Forms.CheckBox
Friend WithEvents chk提示选择 As System.Windows.Forms.CheckBox
Friend WithEvents ch供应商 As System.Windows.Forms.ColumnHeader
Friend WithEvents ContextMenuStrip右键菜单 As System.Windows.Forms.ContextMenuStrip
Friend WithEvents ToolStrip设置为外购件 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents chk展开外协 As System.Windows.Forms.CheckBox
Friend WithEvents ToolStrip设置为外协件 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStrip设置为标准件 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStrip设置为看板件 As System.Windows.Forms.ToolStripMenuItem
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ContextMenuStrip右键菜单.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
Imports Inventor
Imports Inventor.DocumentTypeEnum
Imports Inventor.SelectionFilterEnum
Imports Inventor.SelectTypeEnum
Imports Microsoft.Office.Interop
Imports stdole
Imports System
Imports System.Windows.Forms
Public Class frmImportCodeToIam
Private Sub btn装载_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn装载.Click
lvw文件列表.Items.Clear()
SetStatusBarText()
If IsInventorOpenDocument() = False Then
Me.Dispose()
Exit Sub
End If
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.ActiveEditDocument
If oInventorDocument.DocumentType <> kAssemblyDocumentObject Then
MsgBox("该功能仅适用于部件", MsgBoxStyle.Information)
'Me.Dispose()
Exit Sub
End If
btn装载.Enabled = False
Dim oInteraction As InteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents
oInteraction.Start()
oInteraction.SetCursor(CursorTypeEnum.kCursorTypeWindows, 32514)
Dim oAssemblyDocument As AssemblyDocument
oAssemblyDocument = oInventorDocument
'==============================================================================================
'基于bom结构化数据,可跳过参考的文件
' Set a reference to the BOM
Dim oBOM As BOM
oBOM = oAssemblyDocument.ComponentDefinition.BOM
oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = False
'Set a reference to the "Structured" BOMView
Dim oBOMView As BOMView
lvw文件列表.BeginUpdate()
'获取结构化的bom页面
For Each oBOMView In oBOM.BOMViews
If oBOMView.ViewType = BOMViewTypeEnum.kStructuredBOMViewType Then
'遍历这个bom页面
QueryBOMRowToLoadiPro(oBOMView.BOMRows, lvw文件列表, chk展开子级.Checked, chk展开外协.Checked)
End If
Next
'设置标准件颜色
For Each oListViewItem As ListViewItem In lvw文件列表.Items
If Strings.Left(oListViewItem.Text, 2) = "GB" Or Strings.Left(oListViewItem.Text, 2) = "JB" Then
'oListViewItem.UseItemStyleForSubItems = False
oListViewItem.BackColor = System.Drawing.Color.LightGreen
End If
Next
lvw文件列表.EndUpdate()
Me.Text = "导入ERP编码 ( 共" & lvw文件列表.Items.Count & "个文件)"
oInteraction.Stop()
btn装载.Enabled = True
'ThisApplication.Cursor = Cursors.Default
'==============================================================================================
'' 获取所有引用文档
'Dim oAllReferencedDocuments As DocumentsEnumerator
'oAllReferencedDocuments = oAssemblyDocument.AllReferencedDocuments
'With prgProcess
' .Minimum = 0
' .Maximum = oAllReferencedDocuments.Count
' .Value = 0
'End With
' 遍历这些文档
'For Each ReferencedDocument As Document In oAllReferencedDocuments
' Debug.Print(ReferencedDocument.DisplayName)
' Dim oStockNumPartName As StockNumPartName
' oStockNumPartName = GetPropitems(ReferencedDocument)
' Dim LVI As ListViewItem
' LVI = lvwFileList.Items.Add(oStockNumPartName.StockNum)
' LVI.SubItems.Add(oStockNumPartName.PartName)
' LVI.SubItems.Add(oStockNumPartName.PartNum)
' LVI.SubItems.Add(ReferencedDocument.FullDocumentName)
' prgProcess.Value = prgProcess.Value + 1
'Next
End Sub
Private Sub QueryBOMRowToLoadiPro(ByVal oBOMRows As BOMRowsEnumerator, ByVal olistiview As ListView, ByVal IsExpandChild As Boolean, ByVal IsExpandOutsourcedParts As Boolean)
On Error Resume Next
Dim i As Integer
Dim intStepCount As Integer
intStepCount = oBOMRows.Count
'Create a new ProgressBar object.
'Dim oProgressBar As Inventor.ProgressBar
'oProgressBar = ThisApplication.CreateProgressBar(False, iStepCount, "当前文件: ")
For i = 1 To intStepCount
' Get the current row.
Dim oBOMRow As BOMRow
oBOMRow = oBOMRows.Item(i)
Dim strFullFileName As String
strFullFileName = oBOMRow.ReferencedFileDescriptor.FullFileName
'测试文件
Debug.Print(strFullFileName)
' Set the message for the progress bar
'oProgressBar.Message = oFullFileName
If IsFileExsts(strFullFileName) = False Then '跳过不存在的文件
GoTo 999
End If
'If InStr(strFullFileName, ContentCenterFiles) > 0 Then '跳过零件库文件
' GoTo 999
'End If
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.Documents.Open(strFullFileName, False) '打开文件,不显示
Dim oStockNumPartName As StockNumPartName
oStockNumPartName = GetPropitems(oInventorDocument)
'获取供应商
Dim strVendor As String
strVendor = GetPropitem(oInventorDocument, Map_Vendor)
If IsItemInListView(olistiview, oStockNumPartName.StockNum) = False Then
Dim oListViewItem As ListViewItem
oListViewItem = lvw文件列表.Items.Add(oStockNumPartName.StockNum)
With oListViewItem
.SubItems.Add(oStockNumPartName.PartName)
.SubItems.Add(oStockNumPartName.ERPCode)
.SubItems.Add(strVendor)
.SubItems.Add(strFullFileName)
End With
oInventorDocument.Close(True)
End If
'是否选择了展开子集
If (Not oBOMRow.ChildRows Is Nothing) And IsExpandChild = True Then
Select Case strVendor
Case "外协件"
If IsExpandOutsourcedParts = True Then
Call QueryBOMRowToLoadiPro(oBOMRow.ChildRows, olistiview, IsExpandChild, IsExpandOutsourcedParts)
'Else
' Call QueryBOMRowToLoadiPro(oBOMRow.ChildRows, olistiview, IsExpandChild, IsExpandOutsourcedParts)
End If
Case "外购件"
GoTo 999
Case Else
Call QueryBOMRowToLoadiPro(oBOMRow.ChildRows, olistiview, IsExpandChild, IsExpandOutsourcedParts)
End Select
End If
999:
'oProgressBar.UpdateProgress()
Next
'oProgressBar.Close()
End Sub
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
Private Sub btn查询_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn查询.Click
On Error Resume Next
'PartNum = FindSrtingInSheet(Excel_File_Name, StochNum, Sheet_Name, Table_Array, Col_Index_Num, 0)
btn查询.Enabled = False
Dim oInteraction As InteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents
oInteraction.Start()
oInteraction.SetCursor(CursorTypeEnum.kCursorTypeWindows, 32514)
'System.Threading.Thread.Sleep(5000)
Dim oExcelApplication As Excel.Application
oExcelApplication = New Excel.Application
oExcelApplication.Visible = False
'Excel_File_Name = "E:\软件\Invenotr\Inventor编程\InventorAddIn\code\bin\最新物料编码.xls"
Dim oWorkbook As Excel.Workbook = oExcelApplication.Workbooks.Open(BasicExcelFullFileName, 0, True)
Dim oWorksheet As Excel.Worksheet = Nothing
Dim oRange As Excel.Range = Nothing
For Each oWorksheet In oWorkbook.Sheets
'sht = wb.Sheets(Sheet_Name)
'sht = wb.Sheets("物料")
Dim arrTable(20) As String
arrTable = Split(TableArrays, ",")
Dim dblMatchRow As Double '寻找到的行
With prg进度条
.Minimum = 0
.Maximum = lvw文件列表.Items.Count
.Value = 0
End With
For Each oListViewItem As ListViewItem In lvw文件列表.Items
For Each strTable As String In arrTable
oRange = oWorksheet.Range(strTable & ":" & strTable)
dblMatchRow = 0
dblMatchRow = oExcelApplication.WorksheetFunction.Match(oListViewItem.Text, oRange, 0)
If dblMatchRow <> 0.0 Then
'当前值
Dim strNowRangeValue As String = oListViewItem.SubItems(2).Text
Dim strFindRange As String '寻找的单元
Dim strFindRangeValue As String '寻找的值
'FindRange = "B" & MatchRow
strFindRange = ColIndexNum & dblMatchRow
strFindRangeValue = oWorksheet.Range(strFindRange).Value
If strNowRangeValue <> strFindRangeValue Then
oListViewItem.SubItems(2).Text = strFindRangeValue
oListViewItem.UseItemStyleForSubItems = False
oListViewItem.SubItems(2).ForeColor = Drawing.Color.Red
Exit For
End If
End If
Next
prg进度条.Value = prg进度条.Value + 1
Next
Next
'关闭文件
oWorkbook.Saved = True
oWorkbook.Close()
' 8.退出Excel程序
oExcelApplication.Quit()
'9.释放资源
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRange)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWorksheet)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWorkbook)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcelApplication)
'10.调用GC的垃圾收集方法
GC.Collect()
GC.WaitForPendingFinalizers()
btn查询.Enabled = True
oInteraction.Stop()
End Sub
Private Sub btn写入_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn写入.Click
On Error Resume Next
Dim oInventorDocument As Inventor.Document
Dim strInventorFullFileName As String
Dim strERPCoding As String
btn写入.Enabled = False
Dim oInteraction As InteractionEvents = ThisApplication.CommandManager.CreateInteractionEvents
oInteraction.Start()
oInteraction.SetCursor(CursorTypeEnum.kCursorTypeWindows, 32514)
'System.Threading.Thread.Sleep(5000)
'
With prg进度条
.Minimum = 0
.Maximum = lvw文件列表.Items.Count
.Value = 0
End With
For Each oListViewItem As ListViewItem In lvw文件列表.Items
If oListViewItem.SubItems(2).ForeColor = Drawing.Color.Red Then
oListViewItem.SubItems(2).ForeColor = Drawing.Color.Black '写入后变为黑色
strERPCoding = oListViewItem.SubItems(2).Text
strInventorFullFileName = oListViewItem.SubItems(4).Text
oInventorDocument = ThisApplication.Documents.Open(strInventorFullFileName, False)
SetPropitem(oInventorDocument, Map_ERPCode, strERPCoding)
End If
prg进度条.Value = prg进度条.Value + 1
Next
btn写入.Enabled = True
oInteraction.Stop()
End Sub
Private Sub lvw文件列表_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles lvw文件列表.ColumnClick
If _ListViewSorter = clsListViewSorter.EnumSortOrder.Ascending Then
Dim Sorter As New clsListViewSorter(e.Column, clsListViewSorter.EnumSortOrder.Descending)
lvw文件列表.ListViewItemSorter = Sorter
_ListViewSorter = clsListViewSorter.EnumSortOrder.Descending
Else
Dim Sorter As New clsListViewSorter(e.Column, clsListViewSorter.EnumSortOrder.Ascending)
lvw文件列表.ListViewItemSorter = Sorter
_ListViewSorter = clsListViewSorter.EnumSortOrder.Ascending
End If
End Sub
Private Sub lvw文件列表_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lvw文件列表.MouseDoubleClick
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim strInventorFullFileName As String
strInventorFullFileName = lvw文件列表.SelectedItems(0).SubItems(4).Text
ThisApplication.Documents.Open(strInventorFullFileName)
End If
End Sub
Private Sub lvw文件列表_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvw文件列表.SelectedIndexChanged
Try
If (lvw文件列表.SelectedIndices.Count > 0 And chk提示选择.Checked = True) Then
Dim index As Integer = lvw文件列表.SelectedIndices(0) '选中行的下一行索引
If index < lvw文件列表.Items.Count Then
Dim oListViewItem As ListViewItem = lvw文件列表.Items(index)
Dim strInventorFullFileName As String '文件全名
strInventorFullFileName = oListViewItem.SubItems(4).Text
Dim oInventorAssemblyDocument As Inventor.AssemblyDocument
oInventorAssemblyDocument = ThisApplication.ActiveDocument
'Dim strInventorAssemblyFullFileName As String
'strInventorAssemblyFullFileName = oInventorAssemblyDocument.FullFileName
' 获取装配定义
Dim oAssemblyComponentDefinition As AssemblyComponentDefinition
oAssemblyComponentDefinition = oInventorAssemblyDocument.ComponentDefinition
' 获取装配子集
Dim oComponentOccurrences As ComponentOccurrences
oComponentOccurrences = oAssemblyComponentDefinition.Occurrences
'遍历
For Each oComponentOccurrence As ComponentOccurrence In oComponentOccurrences
If oComponentOccurrence.ReferencedDocumentDescriptor.FullDocumentName = strInventorFullFileName Then
ThisApplication.CommandManager.DoSelect(oComponentOccurrence)
Else
ThisApplication.CommandManager.DoUnSelect(oComponentOccurrence)
End If
Next
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub frmInventoryCoding_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
btn装载_Click(sender, e)
End Sub
Private Sub ContextMenuStrip右键菜单_ItemClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ContextMenuStrip右键菜单.ItemClicked
Try
If (lvw文件列表.SelectedIndices.Count > 0) Then
Dim strInventorFullFileName As String
strInventorFullFileName = lvw文件列表.SelectedItems(0).SubItems(4).Text
Dim oInventorDocument As Inventor.Document '当前文件
oInventorDocument = ThisApplication.Documents.Open(strInventorFullFileName, False)
Dim strVendor As String
strVendor = Strings.Right(e.ClickedItem.Text, 3)
SetPropitem(oInventorDocument, Map_Vendor, strVendor)
lvw文件列表.SelectedItems(0).SubItems(3).Text = strVendor
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmMassiPoperties
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btn开始 = New System.Windows.Forms.Button()
Me.btn关闭 = New System.Windows.Forms.Button()
Me.lst文件列表 = New System.Windows.Forms.ListBox()
Me.btn添加文件 = New System.Windows.Forms.Button()
Me.btn清除列表 = New System.Windows.Forms.Button()
Me.tp自定义 = New System.Windows.Forms.TabPage()
Me.dtp日期 = New System.Windows.Forms.DateTimePicker()
Me.lbl特性名 = New System.Windows.Forms.Label()
Me.txt实数 = New System.Windows.Forms.TextBox()
Me.txt特性名 = New System.Windows.Forms.TextBox()
Me.txt字符串 = New System.Windows.Forms.TextBox()
Me.rdo字符串 = New System.Windows.Forms.RadioButton()
Me.rdo布尔值 = New System.Windows.Forms.RadioButton()
Me.rdo日期 = New System.Windows.Forms.RadioButton()
Me.rdo实数 = New System.Windows.Forms.RadioButton()
Me.Bool布尔值 = New System.Windows.Forms.CheckBox()
Me.tp项目 = New System.Windows.Forms.TabPage()
Me.txt数据 = New System.Windows.Forms.TextBox()
Me.lbl数据 = New System.Windows.Forms.Label()
Me.lbl项目名 = New System.Windows.Forms.Label()
Me.cmb项目名 = New System.Windows.Forms.ComboBox()
Me.tab1 = New System.Windows.Forms.TabControl()
Me.tp自定义.SuspendLayout()
Me.tp项目.SuspendLayout()
Me.tab1.SuspendLayout()
Me.SuspendLayout()
'
'btn开始
'
Me.btn开始.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn开始.Location = New System.Drawing.Point(159, 189)
Me.btn开始.Name = "btn开始"
Me.btn开始.Size = New System.Drawing.Size(70, 28)
Me.btn开始.TabIndex = 1
Me.btn开始.Text = "开始"
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(237, 189)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(70, 28)
Me.btn关闭.TabIndex = 1
Me.btn关闭.Text = "关闭"
'
'lst文件列表
'
Me.lst文件列表.FormattingEnabled = True
Me.lst文件列表.ItemHeight = 12
Me.lst文件列表.Location = New System.Drawing.Point(12, 226)
Me.lst文件列表.Name = "lst文件列表"
Me.lst文件列表.Size = New System.Drawing.Size(271, 148)
Me.lst文件列表.TabIndex = 15
Me.lst文件列表.Visible = False
'
'btn添加文件
'
Me.btn添加文件.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn添加文件.Location = New System.Drawing.Point(3, 189)
Me.btn添加文件.Name = "btn添加文件"
Me.btn添加文件.Size = New System.Drawing.Size(70, 28)
Me.btn添加文件.TabIndex = 0
Me.btn添加文件.Text = "添加文件"
Me.btn添加文件.UseVisualStyleBackColor = True
Me.btn添加文件.Visible = False
'
'btn清除列表
'
Me.btn清除列表.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn清除列表.Location = New System.Drawing.Point(81, 189)
Me.btn清除列表.Name = "btn清除列表"
Me.btn清除列表.Size = New System.Drawing.Size(70, 28)
Me.btn清除列表.TabIndex = 20
Me.btn清除列表.Text = "清除列表"
Me.btn清除列表.UseVisualStyleBackColor = True
Me.btn清除列表.Visible = False
'
'tp自定义
'
Me.tp自定义.Controls.Add(Me.dtp日期)
Me.tp自定义.Controls.Add(Me.lbl特性名)
Me.tp自定义.Controls.Add(Me.txt实数)
Me.tp自定义.Controls.Add(Me.txt特性名)
Me.tp自定义.Controls.Add(Me.txt字符串)
Me.tp自定义.Controls.Add(Me.rdo字符串)
Me.tp自定义.Controls.Add(Me.rdo布尔值)
Me.tp自定义.Controls.Add(Me.rdo日期)
Me.tp自定义.Controls.Add(Me.rdo实数)
Me.tp自定义.Controls.Add(Me.Bool布尔值)
Me.tp自定义.Location = New System.Drawing.Point(4, 22)
Me.tp自定义.Name = "tp自定义"
Me.tp自定义.Padding = New System.Windows.Forms.Padding(3)
Me.tp自定义.Size = New System.Drawing.Size(286, 146)
Me.tp自定义.TabIndex = 1
Me.tp自定义.Text = "自定义"
Me.tp自定义.UseVisualStyleBackColor = True
'
'dtp日期
'
Me.dtp日期.Location = New System.Drawing.Point(81, 115)
Me.dtp日期.Name = "dtp日期"
Me.dtp日期.Size = New System.Drawing.Size(127, 21)
Me.dtp日期.TabIndex = 11
'
'lbl特性名
'
Me.lbl特性名.AutoSize = True
Me.lbl特性名.Location = New System.Drawing.Point(17, 15)
Me.lbl特性名.Name = "lbl特性名"
Me.lbl特性名.Size = New System.Drawing.Size(41, 12)
Me.lbl特性名.TabIndex = 13
Me.lbl特性名.Text = "特性名"
'
'txt实数
'
Me.txt实数.Location = New System.Drawing.Point(81, 87)
Me.txt实数.Name = "txt实数"
Me.txt实数.Size = New System.Drawing.Size(127, 21)
Me.txt实数.TabIndex = 4
'
'txt特性名
'
Me.txt特性名.Location = New System.Drawing.Point(81, 9)
Me.txt特性名.Name = "txt特性名"
Me.txt特性名.Size = New System.Drawing.Size(127, 21)
Me.txt特性名.TabIndex = 12
'
'txt字符串
'
Me.txt字符串.Location = New System.Drawing.Point(81, 36)
Me.txt字符串.Name = "txt字符串"
Me.txt字符串.Size = New System.Drawing.Size(127, 21)
Me.txt字符串.TabIndex = 2
'
'rdo字符串
'
Me.rdo字符串.AutoSize = True
Me.rdo字符串.Location = New System.Drawing.Point(15, 43)
Me.rdo字符串.Name = "rdo字符串"
Me.rdo字符串.Size = New System.Drawing.Size(47, 16)
Me.rdo字符串.TabIndex = 6
Me.rdo字符串.TabStop = True
Me.rdo字符串.Text = "字串"
Me.rdo字符串.UseVisualStyleBackColor = True
'
'rdo布尔值
'
Me.rdo布尔值.AutoSize = True
Me.rdo布尔值.Location = New System.Drawing.Point(15, 67)
Me.rdo布尔值.Name = "rdo布尔值"
Me.rdo布尔值.Size = New System.Drawing.Size(59, 16)
Me.rdo布尔值.TabIndex = 7
Me.rdo布尔值.TabStop = True
Me.rdo布尔值.Text = "布尔值"
Me.rdo布尔值.UseVisualStyleBackColor = True
'
'rdo日期
'
Me.rdo日期.AutoSize = True
Me.rdo日期.Location = New System.Drawing.Point(15, 115)
Me.rdo日期.Name = "rdo日期"
Me.rdo日期.Size = New System.Drawing.Size(47, 16)
Me.rdo日期.TabIndex = 9
Me.rdo日期.TabStop = True
Me.rdo日期.Text = "日期"
Me.rdo日期.UseVisualStyleBackColor = True
'
'rdo实数
'
Me.rdo实数.AutoSize = True
Me.rdo实数.Location = New System.Drawing.Point(15, 91)
Me.rdo实数.Name = "rdo实数"
Me.rdo实数.Size = New System.Drawing.Size(47, 16)
Me.rdo实数.TabIndex = 8
Me.rdo实数.TabStop = True
Me.rdo实数.Text = "实数"
Me.rdo实数.UseVisualStyleBackColor = True
'
'Bool布尔值
'
Me.Bool布尔值.AutoSize = True
Me.Bool布尔值.Location = New System.Drawing.Point(83, 64)
Me.Bool布尔值.Name = "Bool布尔值"
Me.Bool布尔值.Size = New System.Drawing.Size(102, 16)
Me.Bool布尔值.TabIndex = 3
Me.Bool布尔值.Text = "True 或 False"
Me.Bool布尔值.UseVisualStyleBackColor = True
'
'tp项目
'
Me.tp项目.Controls.Add(Me.txt数据)
Me.tp项目.Controls.Add(Me.lbl数据)
Me.tp项目.Controls.Add(Me.lbl项目名)
Me.tp项目.Controls.Add(Me.cmb项目名)
Me.tp项目.Location = New System.Drawing.Point(4, 22)
Me.tp项目.Name = "tp项目"
Me.tp项目.Padding = New System.Windows.Forms.Padding(3)
Me.tp项目.Size = New System.Drawing.Size(286, 146)
Me.tp项目.TabIndex = 0
Me.tp项目.Text = "项目"
Me.tp项目.UseVisualStyleBackColor = True
'
'txt数据
'
Me.txt数据.Location = New System.Drawing.Point(70, 39)
Me.txt数据.Name = "txt数据"
Me.txt数据.Size = New System.Drawing.Size(143, 21)
Me.txt数据.TabIndex = 21
'
'lbl数据
'
Me.lbl数据.AutoSize = True
Me.lbl数据.Location = New System.Drawing.Point(12, 41)
Me.lbl数据.Name = "lbl数据"
Me.lbl数据.Size = New System.Drawing.Size(53, 12)
Me.lbl数据.TabIndex = 20
Me.lbl数据.Text = "数 据:"
'
'lbl项目名
'
Me.lbl项目名.AutoSize = True
Me.lbl项目名.Location = New System.Drawing.Point(12, 14)
Me.lbl项目名.Name = "lbl项目名"
Me.lbl项目名.Size = New System.Drawing.Size(53, 12)
Me.lbl项目名.TabIndex = 19
Me.lbl项目名.Text = "项目名:"
'
'cmb项目名
'
Me.cmb项目名.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cmb项目名.FormattingEnabled = True
Me.cmb项目名.Items.AddRange(New Object() {"零件代号", "库存编号", "描述", "修订号", "项目", "设计人", "工程师", "批准人", "成本中心", "预估成本", "供应商", "Web链接"})
Me.cmb项目名.Location = New System.Drawing.Point(70, 10)
Me.cmb项目名.Name = "cmb项目名"
Me.cmb项目名.Size = New System.Drawing.Size(145, 20)
Me.cmb项目名.TabIndex = 18
'
'tab1
'
Me.tab1.Controls.Add(Me.tp项目)
Me.tab1.Controls.Add(Me.tp自定义)
Me.tab1.Location = New System.Drawing.Point(12, 12)
Me.tab1.Name = "tab1"
Me.tab1.SelectedIndex = 0
Me.tab1.Size = New System.Drawing.Size(294, 172)
Me.tab1.TabIndex = 19
'
'frmiPoperties
'
Me.AcceptButton = Me.btn开始
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn关闭
Me.ClientSize = New System.Drawing.Size(317, 229)
Me.Controls.Add(Me.btn关闭)
Me.Controls.Add(Me.btn开始)
Me.Controls.Add(Me.btn清除列表)
Me.Controls.Add(Me.tab1)
Me.Controls.Add(Me.btn添加文件)
Me.Controls.Add(Me.lst文件列表)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.ImeMode = System.Windows.Forms.ImeMode.Off
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmiPoperties"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "量产iProperty"
Me.tp自定义.ResumeLayout(False)
Me.tp自定义.PerformLayout()
Me.tp项目.ResumeLayout(False)
Me.tp项目.PerformLayout()
Me.tab1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
Friend WithEvents btn开始 As System.Windows.Forms.Button
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents lst文件列表 As System.Windows.Forms.ListBox
Friend WithEvents btn添加文件 As System.Windows.Forms.Button
Friend WithEvents btn清除列表 As System.Windows.Forms.Button
Friend WithEvents tp自定义 As System.Windows.Forms.TabPage
Friend WithEvents dtp日期 As System.Windows.Forms.DateTimePicker
Friend WithEvents lbl特性名 As System.Windows.Forms.Label
Friend WithEvents txt实数 As System.Windows.Forms.TextBox
Friend WithEvents txt特性名 As System.Windows.Forms.TextBox
Friend WithEvents txt字符串 As System.Windows.Forms.TextBox
Friend WithEvents rdo字符串 As System.Windows.Forms.RadioButton
Friend WithEvents rdo布尔值 As System.Windows.Forms.RadioButton
Friend WithEvents rdo日期 As System.Windows.Forms.RadioButton
Friend WithEvents rdo实数 As System.Windows.Forms.RadioButton
Friend WithEvents Bool布尔值 As System.Windows.Forms.CheckBox
Friend WithEvents tp项目 As System.Windows.Forms.TabPage
Friend WithEvents txt数据 As System.Windows.Forms.TextBox
Friend WithEvents lbl数据 As System.Windows.Forms.Label
Friend WithEvents lbl项目名 As System.Windows.Forms.Label
Friend WithEvents cmb项目名 As System.Windows.Forms.ComboBox
Friend WithEvents tab1 As System.Windows.Forms.TabControl
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>39</value>
</metadata>
</root>
\ No newline at end of file
Imports Inventor
Imports System.Windows.Forms
Public Class frmMassiPoperties
Enum enumPType
eString = 0
eBool = 1
eDouble = 2
eDate = 3
End Enum
Private oOption As enumPType = enumPType.eString
Private oUserPropertySet As Inventor.PropertySet
Private PropID As Long = 0
Public Sub getUserPropertySet(ByVal oUSet As Inventor.PropertySet)
'获得缺省的自定义特性集
oUserPropertySet = oUSet
'获取最大PropID
For Each oProperty As Inventor.Property In oUserPropertySet
If oProperty.PropId > PropID Then
PropID = oProperty.PropId
End If
Next
'可接受的PropID范围是: 2 ~ 254 , 256 ~ 0x80000000
If PropID < 2 Then
PropID = 2
End If
End Sub
'量产开始
Private Sub btn开始_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn开始.Click
'Dim thisApprenticeApp = New Inventor.ApprenticeServerComponent()
'Dim thisApprenticeDoc As Inventor.ApprenticeServerDocument
Dim oInventorDocDocument As Inventor.Document
For Each oInventorDocDocument In ThisApplication.Documents
Select Case oInventorDocDocument.DocumentType
Case DocumentTypeEnum.kDrawingDocumentObject, DocumentTypeEnum.kAssemblyDocumentObject, DocumentTypeEnum.kPartDocumentObject
lst文件列表.Items.Add(oInventorDocDocument.FullDocumentName)
End Select
Next
If lst文件列表.Items.Count = 0 Then
MsgBox("未有打开的工程图文件。", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "量产")
Exit Sub
End If
btn开始.Enabled = False
'ThisApplication.Cursor = Cursors.WaitCursor
Select Case tab1.SelectedIndex
Case 0
For i = 0 To lst文件列表.Items.Count - 1
lst文件列表.SelectedIndex = i
'打开文件
oInventorDocDocument = ThisApplication.Documents.ItemByName(lst文件列表.Items(i).ToString)
'打开 项目 选项卡
Dim oPropertySet As PropertySet = oInventorDocDocument.PropertySets.Item("Design Tracking Properties")
'用内部定义名的代码
'Dim oDesignerProp As Inventor.Property = oDTProps.ItemByPropId(Inventor.PropertiesForDesignTrackingPropertiesEnum.kDesignerDesignTrackingProperties)
'oDesignerProp = oDTProps.Item("Designer")
'Debug.Print(oDesignerProp.DisplayName & " = " & oDesignerProp.Value)
'用显示名 displayname 的代码
'定义单个项目
'Dim oProperty As Inventor.Property
'遍历选项卡下的每个单项目
For Each oProperty As Inventor.Property In oPropertySet
If oProperty.DisplayName = cmb项目名.Text Then
'项目名对应,设置数据
oProperty.Value = txt数据.Text.ToString
End If
Next
'保存到文件
'InventorDoc.PropertySets.FlushToFile()
'关闭文件
'InventorDoc.Close()
Next
Case 1
If txt特性名.Text = "" Then
MsgBox("请输入新特性的名字!")
Exit Sub
End If
For i = 0 To lst文件列表.Items.Count - 1
lst文件列表.SelectedIndex = i
'打开文件
oInventorDocDocument = ThisApplication.Documents.ItemByName(lst文件列表.Items(i).ToString)
'打开 项目 选项卡
'Dim oDTProps As PropertySet = thisApprenticeDoc.PropertySets.Item("User Defined Properties")
Dim oProperty As Inventor.Property
'Try
' '若该iProperty已经存在,则直接修改其值
' pEachScale = IdwDoc.PropertySets.Item("User Defined Properties").Item(Map_PrintDay)
' pEachScale.Value = Print_Day
'Catch
' ' 若该iProperty不存在,则添加一个
' IdwDoc.PropertySets.Item("User Defined Properties").Add(Print_Day, Map_PrintDay)
'End Try
'Try
'若该iProperty已经存在,则直接修改其值
oProperty = oInventorDocDocument.PropertySets.Item("User Defined Properties").Item(txt特性名.Text)
Select Case oOption
Case enumPType.eString
oProperty.Value = txt字符串.Text
Case enumPType.eBool
oProperty.Value = Bool布尔值.Checked
Case enumPType.eDouble
oProperty.Value = Convert.ToDouble(txt实数.Text)
Case enumPType.eDate
oProperty.Value = dtp日期.Value
End Select
'Catch
' 若该iProperty不存在,则添加一个
Select Case oOption
Case enumPType.eString
oInventorDocDocument.PropertySets.Item("User Defined Properties").Add(txt字符串.Text, txt特性名.Text, PropID)
Case enumPType.eBool
oInventorDocDocument.PropertySets.Item("User Defined Properties").Add(Bool布尔值.Checked, txt特性名.Text, PropID)
Case enumPType.eDouble
oInventorDocDocument.PropertySets.Item("User Defined Properties").Add(Convert.ToDouble(txt实数.Text), txt特性名.Text, PropID)
Case enumPType.eDate
oInventorDocDocument.PropertySets.Item("User Defined Properties").Add(dtp日期.Value, txt特性名.Text, PropID)
End Select
'End Try
'保存到文件
oInventorDocDocument.PropertySets.FlushToFile()
'关闭文件
'InventorDoc.Close()
Next
End Select
btn开始.Enabled = True
'ThisApplication.Cursor = Cursors.Default
MsgBox("量产工程图文件完成。", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "量产")
End Sub
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
Private Sub frmiPoperties_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmb项目名.Text = EngineerName
rdo字符串.Checked = True
End Sub
Private Sub rdo字符串_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdo字符串.Click
oOption = enumPType.eString
End Sub
Private Sub rdo布尔值_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdo布尔值.Click
oOption = enumPType.eBool
End Sub
Private Sub rdo实数_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdo实数.Click
oOption = enumPType.eDouble
End Sub
Private Sub rdo日期_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdo日期.Click
oOption = enumPType.eDate
End Sub
'添加文件
Private Sub btn添加文件_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn添加文件.Click
'打开文件
Dim oOpenFileDialog As New OpenFileDialog '声名新open 窗口
With oOpenFileDialog
.Filter = "AutoCAD Inventor 文件(*.idw;*.iam;*.ipt)|*.idw;*.iam;*.ipt" '添加过滤文件
.Title = "打开"
.Multiselect = True '多开文件打开
If .ShowDialog = System.Windows.Forms.DialogResult.OK Then '如果打开窗口OK
If .FileName <> "" Then '如果有选中文件
For Each strFullFileName As String In .FileNames
lst文件列表.Items.Add(strFullFileName)
Next
End If
End If
End With
End Sub
'清空文件列表
Private Sub btn清除列表_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn清除列表.Click
lst文件列表.Items.Clear()
End Sub
End Class
\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmPlayer
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btn添加 = New System.Windows.Forms.Button()
Me.btn移出 = New System.Windows.Forms.Button()
Me.lvw文件列表 = New System.Windows.Forms.ListView()
Me.ch约束名称 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch抑制 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch开始 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch结束 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch步长 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ch延时 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.btn关闭 = New System.Windows.Forms.Button()
Me.btn清空 = New System.Windows.Forms.Button()
Me.btn应用 = New System.Windows.Forms.Button()
Me.txt开始 = New System.Windows.Forms.TextBox()
Me.txt结束 = New System.Windows.Forms.TextBox()
Me.txt步长 = New System.Windows.Forms.TextBox()
Me.CheckBox抑制 = New System.Windows.Forms.CheckBox()
Me.txt延时 = New System.Windows.Forms.TextBox()
Me.btn确定编辑 = New System.Windows.Forms.Button()
Me.btn预览 = New System.Windows.Forms.Button()
Me.btn选择约束 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'btn添加
'
Me.btn添加.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn添加.Location = New System.Drawing.Point(17, 336)
Me.btn添加.Name = "btn添加"
Me.btn添加.Size = New System.Drawing.Size(65, 28)
Me.btn添加.TabIndex = 38
Me.btn添加.TabStop = False
Me.btn添加.Text = "添加"
Me.btn添加.UseVisualStyleBackColor = True
'
'btn移出
'
Me.btn移出.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn移出.Location = New System.Drawing.Point(90, 336)
Me.btn移出.Name = "btn移出"
Me.btn移出.Size = New System.Drawing.Size(65, 28)
Me.btn移出.TabIndex = 37
Me.btn移出.Text = "移出"
Me.btn移出.UseVisualStyleBackColor = True
'
'lvw文件列表
'
Me.lvw文件列表.AllowDrop = True
Me.lvw文件列表.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvw文件列表.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ch约束名称, Me.ch抑制, Me.ch开始, Me.ch结束, Me.ch步长, Me.ch延时})
Me.lvw文件列表.FullRowSelect = True
Me.lvw文件列表.Location = New System.Drawing.Point(12, 55)
Me.lvw文件列表.Name = "lvw文件列表"
Me.lvw文件列表.Size = New System.Drawing.Size(632, 263)
Me.lvw文件列表.TabIndex = 35
Me.lvw文件列表.TabStop = False
Me.lvw文件列表.UseCompatibleStateImageBehavior = False
Me.lvw文件列表.View = System.Windows.Forms.View.Details
'
'ch约束名称
'
Me.ch约束名称.Text = "约束名称"
Me.ch约束名称.Width = 120
'
'ch抑制
'
Me.ch抑制.Text = "抑制"
Me.ch抑制.Width = 50
'
'ch开始
'
Me.ch开始.Text = "开始"
Me.ch开始.Width = 100
'
'ch结束
'
Me.ch结束.Text = "结束"
Me.ch结束.Width = 100
'
'ch步长
'
Me.ch步长.Text = "步长"
Me.ch步长.Width = 100
'
'ch延时
'
Me.ch延时.Text = "延时(s)"
Me.ch延时.Width = 100
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.AutoSize = True
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(578, 336)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(65, 28)
Me.btn关闭.TabIndex = 34
Me.btn关闭.Text = "关闭"
'
'btn清空
'
Me.btn清空.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn清空.Location = New System.Drawing.Point(163, 336)
Me.btn清空.Name = "btn清空"
Me.btn清空.Size = New System.Drawing.Size(65, 28)
Me.btn清空.TabIndex = 39
Me.btn清空.Text = "清空"
Me.btn清空.UseVisualStyleBackColor = True
'
'btn应用
'
Me.btn应用.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn应用.AutoSize = True
Me.btn应用.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn应用.Location = New System.Drawing.Point(496, 336)
Me.btn应用.Name = "btn应用"
Me.btn应用.Size = New System.Drawing.Size(65, 28)
Me.btn应用.TabIndex = 40
Me.btn应用.Text = "应用"
'
'txt开始
'
Me.txt开始.Location = New System.Drawing.Point(202, 19)
Me.txt开始.Name = "txt开始"
Me.txt开始.Size = New System.Drawing.Size(72, 21)
Me.txt开始.TabIndex = 44
'
'txt结束
'
Me.txt结束.Location = New System.Drawing.Point(298, 19)
Me.txt结束.Name = "txt结束"
Me.txt结束.Size = New System.Drawing.Size(72, 21)
Me.txt结束.TabIndex = 45
'
'txt步长
'
Me.txt步长.Location = New System.Drawing.Point(391, 19)
Me.txt步长.Name = "txt步长"
Me.txt步长.Size = New System.Drawing.Size(72, 21)
Me.txt步长.TabIndex = 46
'
'CheckBox抑制
'
Me.CheckBox抑制.AutoSize = True
Me.CheckBox抑制.Location = New System.Drawing.Point(139, 20)
Me.CheckBox抑制.Name = "CheckBox抑制"
Me.CheckBox抑制.Size = New System.Drawing.Size(48, 16)
Me.CheckBox抑制.TabIndex = 48
Me.CheckBox抑制.Text = "抑制"
Me.CheckBox抑制.UseVisualStyleBackColor = True
'
'txt延时
'
Me.txt延时.Location = New System.Drawing.Point(488, 19)
Me.txt延时.Name = "txt延时"
Me.txt延时.Size = New System.Drawing.Size(72, 21)
Me.txt延时.TabIndex = 49
'
'btn确定编辑
'
Me.btn确定编辑.Location = New System.Drawing.Point(573, 12)
Me.btn确定编辑.Name = "btn确定编辑"
Me.btn确定编辑.Size = New System.Drawing.Size(59, 30)
Me.btn确定编辑.TabIndex = 50
Me.btn确定编辑.Text = "确定"
Me.btn确定编辑.UseVisualStyleBackColor = True
'
'btn预览
'
Me.btn预览.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn预览.AutoSize = True
Me.btn预览.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn预览.Location = New System.Drawing.Point(245, 336)
Me.btn预览.Name = "btn预览"
Me.btn预览.Size = New System.Drawing.Size(65, 28)
Me.btn预览.TabIndex = 51
Me.btn预览.Text = "预览"
'
'btn选择约束
'
Me.btn选择约束.Location = New System.Drawing.Point(19, 15)
Me.btn选择约束.Name = "btn选择约束"
Me.btn选择约束.Size = New System.Drawing.Size(108, 26)
Me.btn选择约束.TabIndex = 52
Me.btn选择约束.Text = "选择约束"
Me.btn选择约束.UseVisualStyleBackColor = True
'
'frmPlayer
'
Me.AcceptButton = Me.btn添加
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(656, 372)
Me.Controls.Add(Me.btn选择约束)
Me.Controls.Add(Me.btn预览)
Me.Controls.Add(Me.btn确定编辑)
Me.Controls.Add(Me.txt延时)
Me.Controls.Add(Me.CheckBox抑制)
Me.Controls.Add(Me.txt步长)
Me.Controls.Add(Me.txt结束)
Me.Controls.Add(Me.txt开始)
Me.Controls.Add(Me.btn应用)
Me.Controls.Add(Me.btn清空)
Me.Controls.Add(Me.btn添加)
Me.Controls.Add(Me.btn移出)
Me.Controls.Add(Me.lvw文件列表)
Me.Controls.Add(Me.btn关闭)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmPlayer"
Me.ShowIcon = False
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "动画"
Me.TopMost = True
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btn添加 As System.Windows.Forms.Button
Friend WithEvents btn移出 As System.Windows.Forms.Button
Friend WithEvents lvw文件列表 As System.Windows.Forms.ListView
Friend WithEvents ch约束名称 As System.Windows.Forms.ColumnHeader
Friend WithEvents ch抑制 As System.Windows.Forms.ColumnHeader
Friend WithEvents ch开始 As System.Windows.Forms.ColumnHeader
Friend WithEvents ch结束 As System.Windows.Forms.ColumnHeader
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents btn清空 As System.Windows.Forms.Button
Friend WithEvents btn应用 As System.Windows.Forms.Button
Friend WithEvents ch步长 As System.Windows.Forms.ColumnHeader
Friend WithEvents ch延时 As System.Windows.Forms.ColumnHeader
Friend WithEvents txt开始 As System.Windows.Forms.TextBox
Friend WithEvents txt结束 As System.Windows.Forms.TextBox
Friend WithEvents txt步长 As System.Windows.Forms.TextBox
Friend WithEvents CheckBox抑制 As System.Windows.Forms.CheckBox
Friend WithEvents txt延时 As System.Windows.Forms.TextBox
Friend WithEvents btn确定编辑 As System.Windows.Forms.Button
Friend WithEvents btn预览 As System.Windows.Forms.Button
Friend WithEvents btn选择约束 As System.Windows.Forms.Button
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
Imports Inventor
Imports Inventor.DocumentTypeEnum
Imports Inventor.SelectionFilterEnum
Imports Inventor.SelectTypeEnum
Imports Inventor.ObjectTypeEnum
Imports System.Windows.Forms
Public Class frmPlayer
Private IsAddNew As Boolean
'添加
Private Sub btn添加_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn添加.Click
'Try
SetStatusBarText()
If IsInventorOpenDocument() = False Then
Exit Sub
End If
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.ActiveDocument
If oInventorDocument.DocumentType <> kAssemblyDocumentObject Then
MsgBox("该功能仅适用于部件", MsgBoxStyle.Information)
Exit Sub
End If
Dim oInventorAssemblyDocument As Inventor.AssemblyDocument
oInventorAssemblyDocument = oInventorDocument
ThisApplication.CommandManager.Pick(kMateConstraintObject, "选择一个约束")
For Each constrt As Object In oInventorAssemblyDocument.SelectSet
Select Case constrt.type
Case kAngleConstraintObject, kAssemblySymmetryConstraintObject, kCompositeConstraintObject, kCustomConstraintObject, _
kFlushConstraintObject, kInsertConstraintObject, kMateConstraintObject, kTangentConstraintObject, kTransitionalConstraintObject
Dim oAssemblyConstraint As AssemblyConstraint
oAssemblyConstraint = constrt
btn选择约束.Text = oAssemblyConstraint.Name
txt开始.Text = oAssemblyConstraint.DriveSettings.StartValue
txt结束.Text = oAssemblyConstraint.DriveSettings.EndValue
txt步长.Text = oAssemblyConstraint.DriveSettings.FrameRate
Case Else
MsgBox("请选择一个约束。")
End Select
Next
IsAddNew = True
End Sub
'移出
Private Sub btn移出_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn移出.Click
ListViewDel(lvw文件列表)
End Sub
'退出
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
lvw文件列表.Items.Clear()
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
'清空
Private Sub btn清空_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn清空.Click
lvw文件列表.Items.Clear()
End Sub
Private Sub btn预览_Click(sender As Object, e As EventArgs) Handles btn预览.Click
Dim oInventorAssemblyDocument As Inventor.AssemblyDocument
oInventorAssemblyDocument = ThisApplication.ActiveDocument
Dim lvItem As ListViewItem
lvItem = lvw文件列表.SelectedItems(0)
If lvItem Is Nothing Then
Exit Sub
End If
Dim oAssemblyConstraint As AssemblyConstraint
For Each oAssemblyConstraint In oInventorAssemblyDocument.ComponentDefinition.Constraints
If oAssemblyConstraint.Name = lvItem.Text Then
With oAssemblyConstraint.DriveSettings
.StartValue = txt开始.Text.ToString
.EndValue = txt结束.Text.ToString
.GoToStart()
.PlayForward()
.PlayReverse()
End With
Exit Sub
End If
Next
End Sub
Private Sub btn应用_Click(sender As Object, e As EventArgs) Handles btn应用.Click
Dim oInventorAssemblyDocument As Inventor.AssemblyDocument
oInventorAssemblyDocument = ThisApplication.ActiveDocument
Dim lvItem As ListViewItem
lvItem = lvw文件列表.SelectedItems(0)
If lvItem Is Nothing Then
Exit Sub
End If
Dim oAssemblyConstraint As AssemblyConstraint
For Each oAssemblyConstraint In oInventorAssemblyDocument.ComponentDefinition.Constraints
If oAssemblyConstraint.Name = lvItem.Text Then
With oAssemblyConstraint.DriveSettings
.StartValue = txt开始.Text.ToString
.EndValue = txt结束.Text.ToString
.GoToStart()
.PlayForward()
.PlayReverse()
End With
Exit Sub
End If
Next
End Sub
Private Sub btn确定编辑_Click(sender As Object, e As EventArgs) Handles btn确定编辑.Click
Dim oListViewItem As ListViewItem
If IsAddNew = True Then
oListViewItem = lvw文件列表.Items.Add(btn选择约束.Text)
With oListViewItem
.SubItems.Add(CheckBox抑制.Checked)
.SubItems.Add(txt开始.Text)
.SubItems.Add(txt结束.Text)
.SubItems.Add(txt步长.Text)
.SubItems.Add(txt延时.Text)
End With
IsAddNew = False
Else
oListViewItem = lvw文件列表.SelectedItems(0)
With oListViewItem
.Text = btn选择约束.Text
.SubItems(0).Text = CheckBox抑制.Checked
.SubItems(1).Text = txt开始.Text
.SubItems(2).Text = txt结束.Text
.SubItems(3).Text = txt步长.Text
.SubItems(4).Text = txt延时.Text
End With
End If
End Sub
Private Sub btn选择约束_Click(sender As Object, e As EventArgs) Handles btn选择约束.Click
Dim oInventorAssemblyDocument As Inventor.AssemblyDocument
oInventorAssemblyDocument = ThisApplication.ActiveDocument
'Dim oComponentOccurrence As ComponentOccurrence '选择的部件或零件
'If oInventorAssemblyDocument.SelectSet.Count <> 0 Then
' 'For Each oSelect As Object In InventorDoc.SelectSet
' oComponentOccurrence = oInventorAssemblyDocument.SelectSet(1)
' 'Next
'Else
' oComponentOccurrence = ThisApplication.CommandManager.Pick(kMateConstraintObject, "选择零件或部件")
'End If
'If oComponentOccurrence Is Nothing Then '取消选择
' Exit Sub
'End If
'Dim oAssemblyConstraintsEnumerator As AssemblyConstraintsEnumerator
'oAssemblyConstraintsEnumerator = oComponentOccurrence.Constraints
'ComboBox约束列表.Items.Clear()
'For Each oAssemblyConstraint As AssemblyConstraint In oAssemblyConstraintsEnumerator
' ComboBox约束列表.Items.Add(oAssemblyConstraint.Name)
'Next
'For Each constrt As Object In oInventorAssemblyDocument.SelectSet
' Select Case constrt.type
' Case kAngleConstraintObject, kAssemblySymmetryConstraintObject, kCompositeConstraintObject, kCustomConstraintObject, _
' kFlushConstraintObject, kInsertConstraintObject, kMateConstraintObject, kTangentConstraintObject, kTransitionalConstraintObject
' Dim oAssemblyConstraint As AssemblyConstraint
' oAssemblyConstraint = constrt
' btn选择约束.Text = oAssemblyConstraint.Name
' 'txt开始.Text = oAssemblyConstraint.DriveSettings.StartValue
' 'txt结束.Text = oAssemblyConstraint.DriveSettings.EndValue
' 'txt步长.Text = oAssemblyConstraint.DriveSettings.FrameRate
' Case Else
' MsgBox("请选择一个约束。")
' End Select
'Next
Dim oselect As Object
Dim oAssemblyConstraint As AssemblyConstraint = Nothing
If oInventorAssemblyDocument.SelectSet.Count <> 0 Then
'For Each oSelect As Object In InventorDoc.SelectSet
oselect = oInventorAssemblyDocument.SelectSet(1)
Select Case oselect.type
Case kAngleConstraintObject, kAssemblySymmetryConstraintObject, kCompositeConstraintObject, kCustomConstraintObject, _
kFlushConstraintObject, kInsertConstraintObject, kMateConstraintObject, kTangentConstraintObject, kTransitionalConstraintObject
oAssemblyConstraint = oselect
Case Else
End Select
'Next
Else
oAssemblyConstraint = ThisApplication.CommandManager.Pick( kFlushConstraintObject, "选择约束")
End If
If oAssemblyConstraint Is Nothing Then '取消选择
Exit Sub
End If
btn选择约束.Text = oAssemblyConstraint.Name
End Sub
End Class
\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSearchERPCode
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.btn关闭 = New System.Windows.Forms.Button()
Me.txtERP编码 = New System.Windows.Forms.TextBox()
Me.txt规格图号 = New System.Windows.Forms.TextBox()
Me.lbl规格图号 = New System.Windows.Forms.Label()
Me.lblERP编码 = New System.Windows.Forms.Label()
Me.btn查询编码 = New System.Windows.Forms.Button()
Me.btn粘贴到规格 = New System.Windows.Forms.Button()
Me.btn复制编码 = New System.Windows.Forms.Button()
Me.lvw编码列表 = New System.Windows.Forms.ListView()
Me.ColumnHeader规格 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader编码 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.SuspendLayout()
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(274, 85)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(65, 28)
Me.btn关闭.TabIndex = 3
Me.btn关闭.Text = "关闭"
'
'txtERP编码
'
Me.txtERP编码.Location = New System.Drawing.Point(85, 50)
Me.txtERP编码.Name = "txtERP编码"
Me.txtERP编码.Size = New System.Drawing.Size(164, 21)
Me.txtERP编码.TabIndex = 8
'
'txt规格图号
'
Me.txt规格图号.Location = New System.Drawing.Point(85, 16)
Me.txt规格图号.Name = "txt规格图号"
Me.txt规格图号.Size = New System.Drawing.Size(164, 21)
Me.txt规格图号.TabIndex = 0
'
'lbl规格图号
'
Me.lbl规格图号.AutoSize = True
Me.lbl规格图号.Location = New System.Drawing.Point(12, 19)
Me.lbl规格图号.Name = "lbl规格图号"
Me.lbl规格图号.Size = New System.Drawing.Size(77, 12)
Me.lbl规格图号.TabIndex = 5
Me.lbl规格图号.Text = "规格(图号):"
'
'lblERP编码
'
Me.lblERP编码.AutoSize = True
Me.lblERP编码.Location = New System.Drawing.Point(12, 54)
Me.lblERP编码.Name = "lblERP编码"
Me.lblERP编码.Size = New System.Drawing.Size(59, 12)
Me.lblERP编码.TabIndex = 9
Me.lblERP编码.Text = "ERP编码:"
'
'btn查询编码
'
Me.btn查询编码.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn查询编码.Location = New System.Drawing.Point(203, 85)
Me.btn查询编码.Name = "btn查询编码"
Me.btn查询编码.Size = New System.Drawing.Size(65, 28)
Me.btn查询编码.TabIndex = 1
Me.btn查询编码.Text = "查询编码"
'
'btn粘贴到规格
'
Me.btn粘贴到规格.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn粘贴到规格.Location = New System.Drawing.Point(258, 12)
Me.btn粘贴到规格.Name = "btn粘贴到规格"
Me.btn粘贴到规格.Size = New System.Drawing.Size(81, 28)
Me.btn粘贴到规格.TabIndex = 0
Me.btn粘贴到规格.Text = "粘贴到规格"
Me.btn粘贴到规格.UseVisualStyleBackColor = True
'
'btn复制编码
'
Me.btn复制编码.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn复制编码.Location = New System.Drawing.Point(258, 47)
Me.btn复制编码.Name = "btn复制编码"
Me.btn复制编码.Size = New System.Drawing.Size(81, 28)
Me.btn复制编码.TabIndex = 2
Me.btn复制编码.Text = "复制编码"
Me.btn复制编码.UseVisualStyleBackColor = True
'
'lvw编码列表
'
Me.lvw编码列表.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvw编码列表.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader规格, Me.ColumnHeader编码})
Me.lvw编码列表.FullRowSelect = True
Me.lvw编码列表.Location = New System.Drawing.Point(21, 124)
Me.lvw编码列表.Name = "lvw编码列表"
Me.lvw编码列表.Size = New System.Drawing.Size(332, 116)
Me.lvw编码列表.TabIndex = 10
Me.lvw编码列表.UseCompatibleStateImageBehavior = False
Me.lvw编码列表.View = System.Windows.Forms.View.Details
'
'ColumnHeader规格
'
Me.ColumnHeader规格.Text = "规格"
Me.ColumnHeader规格.Width = 200
'
'ColumnHeader编码
'
Me.ColumnHeader编码.Text = "ERP编码"
Me.ColumnHeader编码.Width = 100
'
'frmSearchERPCode
'
Me.AcceptButton = Me.btn查询编码
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.btn关闭
Me.ClientSize = New System.Drawing.Size(365, 251)
Me.Controls.Add(Me.lvw编码列表)
Me.Controls.Add(Me.btn粘贴到规格)
Me.Controls.Add(Me.btn复制编码)
Me.Controls.Add(Me.btn查询编码)
Me.Controls.Add(Me.lblERP编码)
Me.Controls.Add(Me.btn关闭)
Me.Controls.Add(Me.txtERP编码)
Me.Controls.Add(Me.txt规格图号)
Me.Controls.Add(Me.lbl规格图号)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmSearchERPCode"
Me.Padding = New System.Windows.Forms.Padding(9, 8, 9, 8)
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "查询ERP编码"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents txtERP编码 As System.Windows.Forms.TextBox
Friend WithEvents txt规格图号 As System.Windows.Forms.TextBox
Friend WithEvents lbl规格图号 As System.Windows.Forms.Label
Friend WithEvents lblERP编码 As System.Windows.Forms.Label
Friend WithEvents btn查询编码 As System.Windows.Forms.Button
Friend WithEvents btn粘贴到规格 As System.Windows.Forms.Button
Friend WithEvents btn复制编码 As System.Windows.Forms.Button
Friend WithEvents lvw编码列表 As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader规格 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader编码 As System.Windows.Forms.ColumnHeader
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
Imports Inventor
Imports Inventor.DocumentTypeEnum
Imports Inventor.SelectionFilterEnum
Imports System.Windows.Forms
Public NotInheritable Class frmSearchERPCode
Private Sub btn查询编码_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn查询编码.Click
Dim strDrawingNo As String
'Dim strERPCode As String
btn查询编码.Enabled = False
Me.Height = 156
txtERP编码.Text = ""
strDrawingNo = Replace(txt规格图号.Text, vbCrLf, "")
strDrawingNo = Trim(strDrawingNo)
If strDrawingNo = "" Then
btn查询编码.Enabled = True
Exit Sub
End If
'strERPCode = FindSrtingInSheet(BasicExcelFullFileName, strDrawingNo, SheetName, TableArrays, ColIndexNum, 0)
'If strERPCode <> 0 Then
' txtERPCode.Text = strERPCode
'Else
' txtERPCode.Text = "未查询到ERP编码。"
'End If
Dim arraystrERPCode() As String
arraystrERPCode = FindAllSrtingInSheet(BasicExcelFullFileName, strDrawingNo, TableArrays, ColIndexNum, 0)
If arraystrERPCode(0) Is Nothing Then
txtERP编码.Text = "未查询到ERP编码。"
btn查询编码.Enabled = True
Exit Sub
End If
If arraystrERPCode(1) Is Nothing Then
txtERP编码.Text = arraystrERPCode(0)
btn查询编码.Enabled = True
Exit Sub
End If
lvw编码列表.Items.Clear()
Dim oListViewItem As ListViewItem
For Each a In arraystrERPCode
If a Xor Nothing Then
oListViewItem = lvw编码列表.Items.Add(strDrawingNo)
With oListViewItem
.SubItems.Add(a)
End With
End If
Next
'oInteraction.Stop()
Me.Height = 280
btn查询编码.Enabled = True
End Sub
Private Sub btn粘贴到规格_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn粘贴到规格.Click
txt规格图号.Text = My.Computer.Clipboard.GetText
End Sub
Private Sub btn复制编码_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn复制编码.Click
If txtERP编码.Text <> Nothing Then
My.Computer.Clipboard.SetText(txtERP编码.Text)
End If
End Sub
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
Private Sub frmSearchERPCode_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Height = 156
End Sub
Private Sub txt规格图号_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txt规格图号.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
btn查询编码.PerformClick()
End If
End Sub
Private Sub lvw编码列表_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lvw编码列表.SelectedIndexChanged
If lvw编码列表.SelectedIndices.Count > 0 Then
Dim index As Integer = lvw编码列表.SelectedIndices(0) '选中行的下一行索引
txtERP编码.Text = lvw编码列表.Items(index).SubItems(1).Text
End If
End Sub
End Class
\ No newline at end of file
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSetWriteOnly
Inherits System.Windows.Forms.Form
'Form 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.lvw文件列表 = New System.Windows.Forms.ListView()
Me.ColumnHeader文件名 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
Me.ColumnHeader属性 = CType(New System.Windows.Forms.ColumnHeader(),System.Windows.Forms.ColumnHeader)
Me.ColumnHeader模型路径 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader工程图 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader工程图属性 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader工程图路径 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.btn移出 = New System.Windows.Forms.Button()
Me.btn清空列表 = New System.Windows.Forms.Button()
Me.btn关闭 = New System.Windows.Forms.Button()
Me.btn开始 = New System.Windows.Forms.Button()
Me.btn导入当前部件 = New System.Windows.Forms.Button()
Me.CheckBox全选 = New System.Windows.Forms.CheckBox()
Me.CheckBox只读 = New System.Windows.Forms.CheckBox()
Me.CheckBox模型 = New System.Windows.Forms.CheckBox()
Me.CheckBox工程图 = New System.Windows.Forms.CheckBox()
Me.CheckBox本部件 = New System.Windows.Forms.CheckBox()
Me.SuspendLayout()
'
'lvw文件列表
'
Me.lvw文件列表.AllowColumnReorder = True
Me.lvw文件列表.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvw文件列表.AutoArrange = False
Me.lvw文件列表.CheckBoxes = True
Me.lvw文件列表.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader文件名, Me.ColumnHeader属性, Me.ColumnHeader模型路径, Me.ColumnHeader工程图, Me.ColumnHeader工程图属性, Me.ColumnHeader工程图路径})
Me.lvw文件列表.FullRowSelect = True
Me.lvw文件列表.Location = New System.Drawing.Point(17, 13)
Me.lvw文件列表.Name = "lvw文件列表"
Me.lvw文件列表.Size = New System.Drawing.Size(1038, 324)
Me.lvw文件列表.Sorting = System.Windows.Forms.SortOrder.Ascending
Me.lvw文件列表.TabIndex = 44
Me.lvw文件列表.UseCompatibleStateImageBehavior = False
Me.lvw文件列表.View = System.Windows.Forms.View.Details
'
'ColumnHeader文件名
'
Me.ColumnHeader文件名.Text = "文件名"
Me.ColumnHeader文件名.Width = 250
'
'ColumnHeader属性
'
Me.ColumnHeader属性.Text = "只读"
'
'ColumnHeader模型路径
'
Me.ColumnHeader模型路径.Text = "模型路径"
Me.ColumnHeader模型路径.Width = 209
'
'ColumnHeader工程图
'
Me.ColumnHeader工程图.Text = "工程图"
Me.ColumnHeader工程图.Width = 250
'
'ColumnHeader工程图属性
'
Me.ColumnHeader工程图属性.Text = "只读"
'
'ColumnHeader工程图路径
'
Me.ColumnHeader工程图路径.Text = "工程图路径"
Me.ColumnHeader工程图路径.Width = 220
'
'btn移出
'
Me.btn移出.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn移出.Location = New System.Drawing.Point(212, 361)
Me.btn移出.Name = "btn移出"
Me.btn移出.Size = New System.Drawing.Size(69, 28)
Me.btn移出.TabIndex = 43
Me.btn移出.Text = "移除"
Me.btn移出.UseVisualStyleBackColor = True
'
'btn清空列表
'
Me.btn清空列表.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn清空列表.Location = New System.Drawing.Point(135, 361)
Me.btn清空列表.Name = "btn清空列表"
Me.btn清空列表.Size = New System.Drawing.Size(69, 28)
Me.btn清空列表.TabIndex = 41
Me.btn清空列表.Text = "清空列表"
Me.btn清空列表.UseVisualStyleBackColor = True
'
'btn关闭
'
Me.btn关闭.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn关闭.Location = New System.Drawing.Point(998, 361)
Me.btn关闭.Name = "btn关闭"
Me.btn关闭.Size = New System.Drawing.Size(57, 28)
Me.btn关闭.TabIndex = 39
Me.btn关闭.Text = "关闭"
'
'btn开始
'
Me.btn开始.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btn开始.Location = New System.Drawing.Point(935, 361)
Me.btn开始.Name = "btn开始"
Me.btn开始.Size = New System.Drawing.Size(57, 28)
Me.btn开始.TabIndex = 40
Me.btn开始.Text = "开始"
'
'btn导入当前部件
'
Me.btn导入当前部件.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btn导入当前部件.Location = New System.Drawing.Point(17, 361)
Me.btn导入当前部件.Name = "btn导入当前部件"
Me.btn导入当前部件.Size = New System.Drawing.Size(110, 28)
Me.btn导入当前部件.TabIndex = 45
Me.btn导入当前部件.Text = "导入当前部件"
Me.btn导入当前部件.UseVisualStyleBackColor = True
'
'CheckBox全选
'
Me.CheckBox全选.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.CheckBox全选.AutoSize = True
Me.CheckBox全选.Location = New System.Drawing.Point(304, 367)
Me.CheckBox全选.Name = "CheckBox全选"
Me.CheckBox全选.Size = New System.Drawing.Size(48, 16)
Me.CheckBox全选.TabIndex = 46
Me.CheckBox全选.Text = "全选"
Me.CheckBox全选.UseVisualStyleBackColor = True
'
'CheckBox只读
'
Me.CheckBox只读.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.CheckBox只读.AutoSize = True
Me.CheckBox只读.Location = New System.Drawing.Point(360, 367)
Me.CheckBox只读.Name = "CheckBox只读"
Me.CheckBox只读.Size = New System.Drawing.Size(48, 16)
Me.CheckBox只读.TabIndex = 47
Me.CheckBox只读.Text = "只读"
Me.CheckBox只读.UseVisualStyleBackColor = True
'
'CheckBox模型
'
Me.CheckBox模型.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.CheckBox模型.AutoSize = True
Me.CheckBox模型.Location = New System.Drawing.Point(416, 367)
Me.CheckBox模型.Name = "CheckBox模型"
Me.CheckBox模型.Size = New System.Drawing.Size(48, 16)
Me.CheckBox模型.TabIndex = 48
Me.CheckBox模型.Text = "模型"
Me.CheckBox模型.UseVisualStyleBackColor = True
'
'CheckBox工程图
'
Me.CheckBox工程图.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.CheckBox工程图.AutoSize = True
Me.CheckBox工程图.Location = New System.Drawing.Point(472, 367)
Me.CheckBox工程图.Name = "CheckBox工程图"
Me.CheckBox工程图.Size = New System.Drawing.Size(60, 16)
Me.CheckBox工程图.TabIndex = 49
Me.CheckBox工程图.Text = "工程图"
Me.CheckBox工程图.UseVisualStyleBackColor = True
'
'CheckBox本部件
'
Me.CheckBox本部件.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.CheckBox本部件.AutoSize = True
Me.CheckBox本部件.Location = New System.Drawing.Point(855, 367)
Me.CheckBox本部件.Name = "CheckBox本部件"
Me.CheckBox本部件.Size = New System.Drawing.Size(60, 16)
Me.CheckBox本部件.TabIndex = 50
Me.CheckBox本部件.Text = "本部件"
Me.CheckBox本部件.UseVisualStyleBackColor = True
'
'frmSetWriteOnly
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1067, 401)
Me.Controls.Add(Me.CheckBox本部件)
Me.Controls.Add(Me.CheckBox工程图)
Me.Controls.Add(Me.CheckBox模型)
Me.Controls.Add(Me.CheckBox只读)
Me.Controls.Add(Me.CheckBox全选)
Me.Controls.Add(Me.btn导入当前部件)
Me.Controls.Add(Me.lvw文件列表)
Me.Controls.Add(Me.btn移出)
Me.Controls.Add(Me.btn清空列表)
Me.Controls.Add(Me.btn关闭)
Me.Controls.Add(Me.btn开始)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmSetWriteOnly"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "批量只读"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents lvw文件列表 As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader文件名 As System.Windows.Forms.ColumnHeader
Friend WithEvents btn移出 As System.Windows.Forms.Button
Friend WithEvents btn清空列表 As System.Windows.Forms.Button
Friend WithEvents btn关闭 As System.Windows.Forms.Button
Friend WithEvents btn开始 As System.Windows.Forms.Button
Friend WithEvents ColumnHeader属性 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader模型路径 As System.Windows.Forms.ColumnHeader
Friend WithEvents btn导入当前部件 As System.Windows.Forms.Button
Friend WithEvents ColumnHeader工程图 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader工程图属性 As System.Windows.Forms.ColumnHeader
Friend WithEvents CheckBox全选 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox只读 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox模型 As System.Windows.Forms.CheckBox
Friend WithEvents CheckBox工程图 As System.Windows.Forms.CheckBox
Friend WithEvents ColumnHeader工程图路径 As System.Windows.Forms.ColumnHeader
Friend WithEvents CheckBox本部件 As System.Windows.Forms.CheckBox
End Class
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
Imports Inventor
Imports Inventor.DocumentTypeEnum
Imports Microsoft
Imports Microsoft.VisualBasic
Imports stdole
Imports System
Imports System.Collections.ObjectModel
Imports System.Drawing
Imports System.IO
Imports System.Windows.Forms
Public Class frmSetWriteOnly
'量产开始
Private Sub btn开始_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn开始.Click
On Error Resume Next
Dim strInventorDocumentFullFileName As String
Dim strInventorDrawingFullFileName As String
If lvw文件列表.Items.Count = 0 Then
MsgBox("未添加文件。", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "批量另存为")
Exit Sub
End If
For Each oListViewItem As ListViewItem In lvw文件列表.Items
'当前项标记颜色
'oListViewItem.ForeColor = Drawing.Color.BlueViolet
If oListViewItem.Checked = True Then
strInventorDocumentFullFileName = oListViewItem.SubItems(2).Text
strInventorDrawingFullFileName = oListViewItem.SubItems(5).Text
If CheckBox模型.Checked = True Then
SetFileReadOnly(strInventorDocumentFullFileName, CheckBox只读.Checked)
End If
If CheckBox工程图.Checked = True Then
SetFileReadOnly(strInventorDrawingFullFileName, CheckBox只读.Checked)
End If
End If
Next
MsgBox("设置文件属性完成。", MsgBoxStyle.Information + MsgBoxStyle.OkOnly)
End Sub
'关闭
Private Sub btn关闭_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn关闭.Click
lvw文件列表.Items.Clear()
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Dispose()
End Sub
'清空文件列表
Private Sub btn清空列表_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn清空列表.Click
lvw文件列表.Items.Clear()
End Sub
'移除选择列
Private Sub btn移出_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn移出.Click
ListViewDel(lvw文件列表)
End Sub
Private Sub btn导入当前部件_Click(sender As Object, e As EventArgs) Handles btn导入当前部件.Click
lvw文件列表.Items.Clear()
SetStatusBarText()
If IsInventorOpenDocument() = False Then
Exit Sub
End If
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.ActiveDocument
If oInventorDocument.DocumentType <> kAssemblyDocumentObject Then
MsgBox("该功能仅适用于部件", MsgBoxStyle.Information)
Exit Sub
End If
Dim oAssemblyDocument As AssemblyDocument
oAssemblyDocument = oInventorDocument
'===================================
'基于bom结构化数据,可跳过参考的文件
' Set a reference to the BOM
Dim oBOM As BOM
oBOM = oAssemblyDocument.ComponentDefinition.BOM
oBOM.StructuredViewEnabled = True
'Set a reference to the "Structured" BOMView
Dim oBOMView As BOMView
btn导入当前部件.Enabled = False
'ThisApplication.Cursor = Cursors.WaitCursor
lvw文件列表.BeginUpdate()
'获取结构化的bom页面
For Each oBOMView In oBOM.BOMViews
If oBOMView.ViewType = BOMViewTypeEnum.kStructuredBOMViewType Then
'遍历这个bom页面
QueryBOMRowToLoadFile(oBOMView.BOMRows, lvw文件列表)
End If
Next
lvw文件列表.EndUpdate()
btn导入当前部件.Enabled = True
'ThisApplication.Cursor = Cursors.Default
End Sub
Private Sub QueryBOMRowToLoadFile(ByVal oBOMRows As BOMRowsEnumerator, ByVal olistiview As ListView)
Dim i As Integer
Dim iStepCount As Short
iStepCount = oBOMRows.Count
'Create a new ProgressBar object.
'Dim oProgressBar As Inventor.ProgressBar
'oProgressBar = ThisApplication.CreateProgressBar(False, iStepCount, "当前文件: ")
For i = 1 To oBOMRows.Count
' Get the current row.
Dim oBOMRow As BOMRow
oBOMRow = oBOMRows.Item(i)
Dim oInventorDocumentFullFileName As String
oInventorDocumentFullFileName = oBOMRow.ReferencedFileDescriptor.FullFileName
If InStr(oInventorDocumentFullFileName, ContentCenterFiles) > 0 Then '跳过零件库文件
GoTo 999
End If
If IsFileExsts(oInventorDocumentFullFileName) = False Then '跳过不存在的文件
GoTo 999
End If
Dim strInventorDocumentFileName As String
strInventorDocumentFileName = GetFileNameInfo(oInventorDocumentFullFileName).SigleName
Dim strInventorDrawingFullFileName As String
strInventorDrawingFullFileName = GetChangeExtension(oInventorDocumentFullFileName, IDW)
Dim strInventorDrawingFileName As String
strInventorDrawingFileName = GetFileNameInfo(strInventorDrawingFullFileName).SigleName
Dim oListViewItem As ListViewItem
If IsItemInListView(lvw文件列表, strInventorDocumentFileName) = False Then
oListViewItem = lvw文件列表.Items.Add(strInventorDocumentFileName)
With oListViewItem
If GetFileReadOnly(oInventorDocumentFullFileName) = True Then
.SubItems.Add("True")
Else
.SubItems.Add("False")
End If
.SubItems.Add(oInventorDocumentFullFileName)
If IsFileExsts(strInventorDrawingFullFileName) = True Then
.SubItems.Add(strInventorDrawingFileName)
If GetFileReadOnly(strInventorDrawingFullFileName) = True Then
.SubItems.Add("True")
Else
.SubItems.Add("False")
End If
.SubItems.Add(strInventorDrawingFullFileName)
Else
.SubItems.Add("")
End If
End With
End If
'遍历下一级
If (Not oBOMRow.ChildRows Is Nothing) Then
Call QueryBOMRowToLoadFile(oBOMRow.ChildRows, olistiview)
End If
999:
'oProgressBar.UpdateProgress()
Next
'oProgressBar.Close()
End Sub
'窗口打开自动加载当前部件
Private Sub frmSetWriteOnly_Load(sender As Object, e As EventArgs) Handles MyBase.Load
btn导入当前部件_Click(sender, e)
End Sub
Private Sub CheckBox全选_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox全选.CheckedChanged
lvw文件列表.BeginUpdate()
For Each oListViewItem As ListViewItem In lvw文件列表.Items
oListViewItem.Checked = CheckBox全选.Checked
Next
lvw文件列表.EndUpdate()
End Sub
Private Sub CheckBox本部件_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox本部件.CheckedChanged
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.ActiveDocument
Dim strInventorDocumentFullFileName As String
strInventorDocumentFullFileName = oInventorDocument.FullDocumentName
SetFileReadOnly(strInventorDocumentFullFileName, CheckBox本部件.Checked)
End Sub
End Class
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Imports Inventor
Imports Inventor.AssetTypeEnum
Imports Inventor.BOMStructureEnum
Imports Inventor.DocumentTypeEnum
Imports Inventor.DrawingViewTypeEnum
Imports Inventor.IOMechanismEnum
Imports Inventor.PrintOrientationEnum
Imports Inventor.PropertyTypeEnum
Imports Inventor.SelectionFilterEnum
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel.XlCellType
Imports Microsoft.Office.Interop.Excel.XlFileFormat
Imports System.Collections.ObjectModel
Imports System.IO
Imports System.Text
Imports System.Windows.Forms
Module IptModule
'打开对应的工程图
Public Sub OpenIdwFile()
On Error Resume Next
SetStatusBarText()
If IsInventorOpenDocument() = False Then
Exit Sub
End If
If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject And ThisApplication.ActiveDocumentType <> kPartDocumentObject Then
MsgBox("该功能仅适用于零部件。", MsgBoxStyle.Information)
Exit Sub
End If
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.ActiveDocument
If oInventorDocument.SelectSet.Count <> 0 Then
'For Each oSelect As Object In InventorDoc.SelectSet
For Each ComponentOccurrence As ComponentOccurrence In oInventorDocument.SelectSet()
oInventorDocument = ThisApplication.Documents.ItemByName(ComponentOccurrence.ReferencedDocumentDescriptor.FullDocumentName)
OpenDrawingDocument(oInventorDocument)
Exit Sub
Next
Else
OpenDrawingDocument(oInventorDocument)
Exit Sub
End If
'Catch ex As Exception
' MsgBox(ex.Message)
'End Try
End Sub
'另存为stp文件
Public Sub AsmIptSaveAsStp()
Try
SetStatusBarText()
If IsInventorOpenDocument() = False Then
Exit Sub
End If
If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject And ThisApplication.ActiveDocumentType <> kPartDocumentObject Then
MsgBox("该功能仅适用于零部件。", MsgBoxStyle.Information)
Exit Sub
End If
Dim oInventorDocument As Inventor.Document
oInventorDocument = ThisApplication.ActiveDocument
Dim strInventorDocument As String
strInventorDocument = oInventorDocument.FullFileName
'If strInventorDocument = "" Then
' MsgBox("请先保存本零部件。", MsgBoxStyle.Information)
' Exit Sub
'End If
Dim strStpFullFileName As String 'cad 文件全文件名
strStpFullFileName = GetChangeExtension(strInventorDocument, STP)
strStpFullFileName = SetNewFile(strStpFullFileName, "STEP文件(*.stp)|*.stp")
If strStpFullFileName = "取消" Then
Exit Sub
End If
AsmIptSaveAsStpSub(oInventorDocument, strStpFullFileName)
If IsFileExsts(strStpFullFileName) Then
SetStatusBarText("另存为STEP完成")
If MsgBox("是否打开文件: " & strStpFullFileName, MsgBoxStyle.Question + MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
System.Diagnostics.Process.Start(strStpFullFileName)
End If
Else
SetStatusBarText("错误")
MsgBox("错误。", MsgBoxStyle.Exclamation)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
'另存为 stp文件子过程
Public Sub AsmIptSaveAsStpSub(ByVal InventorDocument As Inventor.Document, ByVal strStepFullFileName As String)
' Get the STEP translator Add-In.
Dim oSTEPTranslator As TranslatorAddIn
oSTEPTranslator = ThisApplication.ApplicationAddIns.ItemById("{90AF7F40-0C01-11D5-8E83-0010B541CD80}")
If oSTEPTranslator Is Nothing Then
'MsgBox("无法转换为Step文件。")
Exit Sub
End If
Dim oContext As TranslationContext
oContext = ThisApplication.TransientObjects.CreateTranslationContext
Dim oOptions As NameValueMap
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
If oSTEPTranslator.HasSaveCopyAsOptions(ThisApplication.ActiveDocument, oContext, oOptions) Then
' Set application protocol.
' 2 = AP 203 - Configuration Controlled Design
' 3 = AP 214 - Automotive Design
oOptions.Value("ApplicationProtocolType") = 3
' Other options...
'oOptions.Value("Author") = ""
'oOptions.Value("Authorization") = ""
'oOptions.Value("Description") = ""
'oOptions.Value("Organization") = ""
oContext.Type = kFileBrowseIOMechanism
Dim oData As DataMedium
oData = ThisApplication.TransientObjects.CreateDataMedium
oData.FileName = strStepFullFileName
Call oSTEPTranslator.SaveCopyAs(InventorDocument, oContext, oOptions, oData)
End If
End Sub
End Module
\ No newline at end of file
此差异已折叠。
此差异已折叠。
Option Strict Off
Option Explicit On
Module ini
'//声明从INI配置文件中获取类型为Int的配置项的值的系统函数
Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
'//声明从INI配置文件中获取类型为string的配置项的值的系统函数
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
'//声明向INI配置文件中写入类型为string的配置项的值的系统函数
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Integer
'//从INI配置文件中获取类型为Int的配置项的值
Public Function GetIntFromINI(ByVal sectionName As String, ByVal keyName As String, ByVal defaultValue As Integer, ByVal iniPath As String) As Integer
GetIntFromINI = GetPrivateProfileInt(sectionName, keyName, defaultValue, iniPath)
End Function
'//删除节点
Public Sub EraseSection(ByVal Section As String, ByVal FileName As String)
WritePrivateProfileString(Section, Nothing, Nothing, FileName)
End Sub
'//从INI配置文件中获取类型为string的配置项的值
Public Function GetStrFromINI(ByVal sectionName As String, ByVal keyName As String, ByVal defaultValue As String, ByVal iniPath As String) As String
Dim buffer As String
Dim rc As Integer
buffer = Space(256)
rc = GetPrivateProfileString(sectionName, keyName, defaultValue, buffer, buffer.Length, iniPath)
GetStrFromINI = Left(buffer, InStr(buffer, vbNullChar) - 1)
End Function
'//向INI配置文件中写入类型为string的配置项的值
Public Function WriteStrINI(ByVal sectionName As String, ByVal keyName As String, ByVal setValue As String, ByVal iniPath As String) As Integer
Dim rc As Integer
rc = WritePrivateProfileString(sectionName, keyName, setValue, iniPath)
If rc Then
rc = 1
End If
WriteStrINI = rc
End Function
End Module
\ No newline at end of file
1.21.11.18
\ No newline at end of file
1.23.06.28
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册