Hello,
Recently I stumbled across a handy tool which allows to constrain all the parts in an assembly to the origin (by grounding, measuring the distances to the origin planes and then applying the new constraints)
However I thought that it would be good if there was an option to apply these changes only to selected parts, like in this post:
Dim comps As ObjectCollection Dim comp As Object comps = ThisApplication.TransientObjects.CreateObjectCollection While True comp = ThisApplication.CommandManager.Pick( SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select a component") ' If nothing gets selected then we're done If IsNothing(comp) Then Exit While comps.Add(comp) End While ' If there are selected components we can do something For Each comp In comps comp.Delete() Next
https://adndevblog.typepad.com/manufacturing/2013/11/do-selection-from-ilogic.html
However, my attempts to integrate it somehow in the initial code, substituting the original for loop failed - it either ended with error or just removed all the existing constraints;
if possible, could someone with deeper knowledge of iLogic and scripting suggest the proper way of adding it (if something like this can be performed of course)?
Thank you in advance for your help
Hi @ANPGX2JT
Can you attach your attempt here. It will give us a better understanding of what your atemmpting to do and also give you some pointers on where things may have gone wrong for you.
A tip for debugging. With lot of loops like this I like to remove the actuation portions of the code and just make sure you can target the correct occurrence name. So comment off all other code operations and first return the correct occurrence names. Then reintroduce the operations one by one and check your result with a message box or logger statement.
Can't find what you're looking for? Ask the community or share your knowledge.