可以的。参考如下代码
- Dim AssyDoc As AssemblyDocument= ThisDoc.Document
- Dim oAssyDef As AssemblyComponentDefinition = AssyDoc.ComponentDefinition
- Dim oBOM As BOM = oAssyDef.BOM
- oBOM.PartsOnlyViewEnabled = True
- Dim oBOMView As BOMView = oBOM.BOMViews.Item(3)
- Dim oCompDef As ComponentDefinition
- Dim CompFileNameOnly As String
- For Each oBOMRow As BOMRow In oBOMView.BOMRows
- oCompDef = oBOMRow.ComponentDefinitions.Item(1)
- CompFileNameOnly = oCompDef.Document.displayname
- iProperties.Value(CompFileNameOnly, "Custom", "打印时间") =“时间”Next
复制代码 |