Clicking "OK" in the Group dialog box using maxscript


#1

Hi, I am pretty new at max-scripting. I have a whole bunch of objects that are arranged in layers and wanting to create a loop that generates Groups for all these different layers. My issue currently is that when I am looping through this process I have to manually hit enter when the Group dialog box appears. Is there an easy way of hitting the “ok” button though maxscript? Thanks


#2
(
	for i = 0 to layerManager.count - 1 do
	(
		layer = layerManager.getLayer i
		layerName = layer.name
		layerNodesArr = #()
		layer.nodes &layerNodesArr
		grp = group layerNodesArr name:layerName 
		if isValidNode grp do layer.addNode grp
	)
)

#3

This works perfectly! thank you so much for your help!