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

1.22.4.8

[+]新增查询父文件夹打开工程图
[+]修正写iProperty空字符串覆盖
[+]增加快速打开文件
上级 ecf3fd09
......@@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("InventorAddIn For Inventor 2015")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("InAI For 2015")>
<Assembly: AssemblyCopyright("leaky114")>
<Assembly: AssemblyCopyright("")>
<Assembly: AssemblyTrademark("")>
'The following GUID is for the ID of the typelib if this project is exposed to COM
......@@ -28,5 +28,5 @@ Imports System.Runtime.InteropServices
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:
<Assembly: AssemblyVersion("1.22.03.10")>
<Assembly: AssemblyFileVersionAttribute("1.22.03.10")>
\ No newline at end of file
<Assembly: AssemblyVersion("1.22.4.8")>
<Assembly: AssemblyFileVersionAttribute("1.22.4.8")>
\ No newline at end of file
......@@ -65,3 +65,9 @@
1.22.3.10
[+]优化批量打印【从部件导入】的策略
[+]增加批量打印文件列表操作右键菜单
1.22.4.8
[+]新增查询父文件夹打开工程图
[+]修正写iProperty空字符串覆盖
[+]增加快速打开文件
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmQuitOpen
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.OK_Button = New System.Windows.Forms.Button()
Me.Cancel_Button = New System.Windows.Forms.Button()
Me.lvwFileListView = New System.Windows.Forms.ListView()
Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.SuspendLayout()
'
'OK_Button
'
Me.OK_Button.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.OK_Button.Location = New System.Drawing.Point(520, 136)
Me.OK_Button.Name = "OK_Button"
Me.OK_Button.Size = New System.Drawing.Size(75, 28)
Me.OK_Button.TabIndex = 2
Me.OK_Button.Text = "确定"
'
'Cancel_Button
'
Me.Cancel_Button.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Cancel_Button.Location = New System.Drawing.Point(600, 136)
Me.Cancel_Button.Name = "Cancel_Button"
Me.Cancel_Button.Size = New System.Drawing.Size(75, 28)
Me.Cancel_Button.TabIndex = 3
Me.Cancel_Button.Text = "取消"
'
'lvwFileListView
'
Me.lvwFileListView.AllowColumnReorder = True
Me.lvwFileListView.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvwFileListView.AutoArrange = False
Me.lvwFileListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1})
Me.lvwFileListView.FullRowSelect = True
Me.lvwFileListView.Location = New System.Drawing.Point(12, 12)
Me.lvwFileListView.Name = "lvwFileListView"
Me.lvwFileListView.Size = New System.Drawing.Size(663, 118)
Me.lvwFileListView.Sorting = System.Windows.Forms.SortOrder.Ascending
Me.lvwFileListView.TabIndex = 37
Me.lvwFileListView.UseCompatibleStateImageBehavior = False
Me.lvwFileListView.View = System.Windows.Forms.View.Details
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "文件名"
Me.ColumnHeader1.Width = 650
'
'frmQuitOpen
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(687, 176)
Me.Controls.Add(Me.lvwFileListView)
Me.Controls.Add(Me.OK_Button)
Me.Controls.Add(Me.Cancel_Button)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmQuitOpen"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "快速打开"
Me.ResumeLayout(False)
End Sub
Friend WithEvents OK_Button As System.Windows.Forms.Button
Friend WithEvents Cancel_Button As System.Windows.Forms.Button
Friend WithEvents lvwFileListView As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader1 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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
Imports System.Windows.Forms
Public Class frmQuitOpen
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Close()
End Sub
Private Sub OK_Button_Click(sender As System.Object, e As System.EventArgs) Handles OK_Button.Click
If lvwFileListView.SelectedItems.Count <> 0 Then
ThisApplication.Documents.Open(lvwFileListView.SelectedItems(0).Text)
End If
Me.DialogResult = System.Windows.Forms.DialogResult.OK
me.close
End Sub
End Class
......@@ -4,6 +4,8 @@ Imports System.Text.Encoding
Imports System.IO.FileStream
Imports System.Windows.Forms
Imports Microsoft.VisualBasic.FileIO
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Module BasicFileSystem
......
......@@ -8,6 +8,7 @@ Imports Inventor.IOMechanismEnum
Imports System.Windows.Forms
Imports Inventor.PrintOrientationEnum
Imports System.Text
Imports System.Collections.ObjectModel
Module InventorBasic
......@@ -366,11 +367,17 @@ Module InventorBasic
For Each propitem In oPropSet '设置iproperty
Select Case propitem.DisplayName
Case Map_PartName
propitem.Value = StockNumPartName.PartName
If StockNumPartName.PartName <> "" Then
propitem.Value = StockNumPartName.PartName
End If
Case Map_StochNum
propitem.Value = StockNumPartName.StockNum
If StockNumPartName.StockNum <> "" Then
propitem.Value = StockNumPartName.StockNum
End If
Case Map_PartNum
propitem.Value = StockNumPartName.PartNum
If StockNumPartName.PartNum <> "" Then
propitem.Value = StockNumPartName.PartNum
End If
Case "描述"
' propitem.Value = ""
End Select
......@@ -1707,7 +1714,7 @@ Module InventorBasic
End Sub
'打开活动文件对应的工程图
Public Sub OpenDrawingDocument(ByVal oInventorDocument As Inventor.Document)
Public Sub OpenDrawingDocument(ByVal InventorDocument As Inventor.Document)
Try
SetStatusBarText()
......@@ -1725,21 +1732,70 @@ Module InventorBasic
Dim InventorFullName As String '模型文件
Dim IdwFullFileName As String '工程图全文件名
InventorFullName = oInventorDocument.FullDocumentName
InventorFullName = InventorDocument.FullDocumentName
IdwFullFileName = Strings.Replace(InventorFullName, LCaseGetFileExtension(InventorFullName), ".idw")
'当前文件夹查询没有就 到父文件夹查询
If IsFileExsts(IdwFullFileName) = False Then
SearchDrawingDocumentInPresentFolder(InventorDocument, 3)
End If
'查询到工程图
If IsFileExsts(IdwFullFileName) Then
ThisApplication.Documents.Open(IdwFullFileName)
Else
MsgBox(InventorFullName & "没有对应的工程图。", MsgBoxStyle.Information, "打开工程图")
If SearchDrawingDocumentInPresentFolder(InventorDocument, 3) = False Then
MsgBox(InventorFullName & "没有对应的工程图。", MsgBoxStyle.Information, "打开工程图")
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
'到父文件夹查询工程图 ,inventor 文档 ,向上查询的层级
Public Function SearchDrawingDocumentInPresentFolder(ByVal InventorDocument As Inventor.Document, PresidentLevel As Integer) As Boolean
Dim PrsentFolder As String '父文件夹
Dim InventorFullFileName As String '模型文件全名
Dim InventorFileName As String '模型文件名
Dim IdwFullFileName As String '工程图全文件名
Dim IdwFileName As String '工程图名
Dim i As Integer
InventorFullFileName = InventorDocument.FullDocumentName
InventorFileName = GetFileNameInfo(InventorFullFileName).SigleName
IdwFileName = GetFileNameInfo(InventorFullFileName).ONlyName + IDW
i = 0
PrsentFolder = System.IO.Directory.GetParent(InventorFullFileName).FullName
Do
If IsDirectoryExists(PrsentFolder) = True Then
PrsentFolder = System.IO.Directory.GetParent(PrsentFolder).FullName
i = i + 1
Else
Exit Do
End If
Loop While (i <> PresidentLevel)
Dim Files As ReadOnlyCollection(Of String)
Files = My.Computer.FileSystem.GetFiles(PrsentFolder, FileIO.SearchOption.SearchAllSubDirectories, IdwFileName)
If files.Count <> 0 Then
For Each IdwFullFileName In files
ThisApplication.Documents.Open(IdwFullFileName)
Next
Return True
Else
Return False
End If
End Function
'-------------------------------------------------------------------------------------------------------
'批量替换部件下子集的名字
' 组件,被替换的文件名,替换的文件名
......
......@@ -460,6 +460,26 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
'''</summary>
Friend ReadOnly Property 快速打开161624() As System.Drawing.Icon
Get
Dim obj As Object = ResourceManager.GetObject("快速打开161624", resourceCulture)
Return CType(obj,System.Drawing.Icon)
End Get
End Property
'''<summary>
''' 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
'''</summary>
Friend ReadOnly Property 快速打开323224() As System.Drawing.Icon
Get
Dim obj As Object = ResourceManager.GetObject("快速打开323224", resourceCulture)
Return CType(obj,System.Drawing.Icon)
End Get
End Property
'''<summary>
''' 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
'''</summary>
......
......@@ -238,6 +238,13 @@
<data name="微信" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\微信.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="快速打开161624" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\快速打开161624 .ICO;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="快速打开323224" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\快速打开323224.ICO;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="打印161624" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\打印161624.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
......@@ -373,7 +380,6 @@
<data name="空白323224" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\空白323224.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="统计161624" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\统计161624.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
......
B'设置为一个动作,可一次撤销
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册