既然你已經拿到了文件,你可以通過迭代PropertySets和其中的屬性有兩個For-Each-Loop,例如:
Dim oPropSets As PropertySets
oPropSets = oDoc.PropertySets
Dim oPropSet As PropertySet
For Each oPropSet In oPropSets
Dim oPartProp As Inventor.Property
For Each oPartProp In oPropSet
Dim oPropertyValue As Object
If oPartProp.Value Is Nothing Then
'NullValue-Properties are ignored
ElseIf oPartProp Is Nothing Then
'Null-Properties are ignored too
ElseIf System.String.Equals(oPartProp.Value.ToString.Trim, "") Then
'Properties with empty values are also ignored
Else
'And here you have your Property:
Debug.Print(oPartProp.Name & "=" & oPartProp.Value.ToS5tring & vbLf)
End If
Next
Next
謝謝先生..在這裏打印文檔的文件名稱。我需要打印對象使用的平均長度,寬度等的屬性.... – Arun
檢查教程:http://download.autodesk.com/us/community/mfg/Part_1.pdf http://download.autodesk.com/us/community/mfg/Part_2.pdf http://download.autodesk.com/us/community/mfg/Part_3.pdf http://download.autodesk.com /us/community/mfg/Part_4.pdf – rags