Notifications
Clear all

[Closed] run through selection

My script doesn’t seem to run through multiple selections only if I select objects one at a time and run this script it works perfectly.

If I select 1 object it puts showfrozeningray on false and freezes the selection like it should.

But when I select like 2 or more objects only the first one is not grey, so it looks like the IF script only works for the first object.

Any ideas?

   
 (
	for o in selection do
	(
	 if o.showFrozenInGray == true then
	 (
		o.showFrozenInGray = false
		max freeze selection
		max tool zoomextents all 
	 )
	 else
	 (
	max freeze selection
	max tool zoomextents all 
	)
)
)

2 Replies

(
   local tArr = selection as array
   tArr.showFrozenInGray = not (tArr.isFrozen =  true)
   max tool zoomextents all 
)

?

bloody brilliant. Thank you Raphael, works like a charm