If you place instances of one component, you get end cap: 1, end cap: 2, end cap: 3, end cap: 4
If you delete one - say end cap: 3 then the counter does not get fixed automatically. You can manually fix it by clicking the name in the browser twice (not double-click - just click to highlight, then click again to rename).
可以试试如下iLogic规则
Dim AssyDoc As AssemblyDocument = ThisDoc.Document
Dim oCD As AssemblyComponentDefinition = AssyDoc.ComponentDefinition
Dim dict As New Dictionary(Of String, Integer)()
For Each oCc As ComponentOccurrence In oCD.Occurrences
oCNm= System.IO.Path.GetFileNameWithoutExtension(oCc.Definition.Document.fullFileName)
If dict.ContainsKey(oCNm) Then
dict(oCNm) += 1
oCc.Name = oCNm & ":" & dict(oCNm)
Else
dict.Add(oCNm,1)
oCc.Name = oCNm & ":" & "1"
End If
Next
If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!
如果我的回帖解决了您的问题,请点击 "接受为解决方案" 按钮. 这可以帮助其他人更快的找到解决方案!
王 承之
Autodesk AGN [Inventor 俱乐部] Leader
Inventor Club | Bilibili
If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!
如果我的回帖解决了您的问题,请点击 "接受为解决方案" 按钮. 这可以帮助其他人更快的找到解决方案!
王 承之
Autodesk AGN [Inventor 俱乐部] Leader
Inventor Club | Bilibili