蒹葭苍苍,白露为霜。
所谓伊人,在水一方。

简易的BOM明细输出

可用ilogic直接保存运行,代码如下:

Dim oDoc As Document = ThisApplication.ActiveDocument
If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
Dim oADO As Inventor.ComponentOccurrences = oDoc.ComponentDefinition.Occurrences
Dim ES As String = vbNullString
For Each aDoc As Document In oDoc.AllReferencedDocuments
Dim sFN As String = aDoc.FullFileName
Dim Amount As Integer = oADO.AllReferencedOccurrences(aDoc).Count
Dim oPropsets As PropertySets = aDoc.PropertySets
Dim oPropSet As PropertySet = oPropsets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")
Dim PN As String = oPropSet("Part Number").Expression
If ES <> vbNullString Then ES += vbNewLine
ES += PN & " " & CStr(Amount)
Next
MsgBox(ES)

PPRFGUVOVAA31L5WG1X_thumb2

赞(0) 打赏
未经允许不得转载:酷居科技 » 简易的BOM明细输出

评论 1

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    好东西谢谢分享

    跨境电商运营7年前 (2017-08-29)回复

锦瑟无端五十弦,一弦一柱思华年

酷居科技联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏