01-29-2024
03:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-29-2024
03:00 AM
Hi all,
I want to make a rule that deletes all the components and constraints in an assembly before running another rule. I know you can do this individually* but as I add to the project, I will have to continuously update this list. How do I make this select all components and constraints in the assembly?
*Individually:
Components.Delete("hosetail") Components.Delete("HexRawMaterial") Constraints.Delete("Mate:1") Constraints.Delete("Mate:2")
Thanks,
Harvey
Solved! Go to Solution.
01-29-2024
03:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-29-2024
03:35 AM
Hi @harvey_craig2RCUH . This iLogic rule deletes all patterns and all occurrences in your assembly.
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Do
For Each oPOcc As OccurrencePattern In oDef.OccurrencePatterns
Try : oPOcc.Delete() : Catch : End Try
Next
Loop While oDef.OccurrencePatterns.Count > 0
For Each oOcc As ComponentOccurrence In oDef.Occurrences
oOcc.Delete2(True)
Next
Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor
LinkedIn | My free Inventor Addin | My Repositories
Did you find this reply helpful ? If so please use the Accept as Solution/Like.
01-29-2024
03:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report