赞
踩
Sub splitName()
Dim oDoc As Inventor.Document
Set oDoc = ThisApplication.ActiveDocument
'获取名称
Dim fName As String
fName = Left(oDoc.DisplayName, Len(oDoc.DisplayName) - 4)
'Debug.Print fName
'分离名称图号
Dim sName() As String
sName() = split(fName, "#")
'Debug.Print sName(0)
' Get the design tracking property set.
Dim invCustomPropertySet As PropertySet
Set invCustomPropertySet = oDoc.PropertySets.Item("Inventor User Defined Properties")
' Edit the values of a couple of properties.
invCustomPropertySet.Item("零件号").Value = sName(0)
invCustomPropertySet.Item("零件名称").Value = sName(1)
End Sub
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。