Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 532

Do selection from iLogic

$
0
0

By Adam Nagy

The only way you can do a selection from iLogic is using the Pick function. However, you can keep calling that in a loop to enable the user to select multiple components as well. Then you can do something with the selected components - in this specific case, we'll delete them:

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

Viewing all articles
Browse latest Browse all 532

Trending Articles