04-08-2021
04:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-08-2021
04:32 PM
That's simple enough to achieve. I have assumed this is in a part. Each extrusion name will need to be unique so something like SL1-1, SL1-2 etc SL1 to identify the slot size and 1,2,3 to uniquely identify each one .
Quicky modified it from this post.
https://forums.autodesk.com/t5/inventor-forum/ilogic-feature-counting/td-p/8659430
If you place this rule in the document and set event trigger to on Save or model parameter change.
The down side is you need to rename the extrusion name in the browser.
Dim oDoc As PartDocument oDoc = ThisApplication.ActiveDocument Dim ExtrusionList As New ArrayList ' If a feature is Active (not suppressed), it is added the FeatureList array For Each oExtrusion In oDoc.ComponentDefinition.Features.ExtrudeFeatures If oExtrusion.Name.Contains("SL1") Then If Feature.IsActive(oExtrusion.Name) Then ExtrusionList.Add(oExtrusion.Name) End If End If Next ' Count the number of items in the FeatureList array Dim FeatureCount As Integer FeatureCount = ExtrusionList.Count 'Turn off these message boxes if not needed. MessageBox.Show(FeatureCount, "iLogic") d0 = InputListBox("Prompt", ExtrusionList, d0, Title := "Title", ListName := "List") 'Places the FeatureCount value into the User parameter Parameter("Extrusion_Slots1") = FeatureCount
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan
Or if this helped you, please, click (like)
Regards
Alan