loop question

Hello,
This is probably very simple.
Why won't this work when only one object is selected?
Thanks!
Caleb

	on btn_objRenamer pressed do (
		for n in 1 to $.count do (
			$[n].name = $[n].name + objSuffix
		)
	)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pixamoon's picture

`

Hi,

Do not use for that "$" but "selection"

on btn_objRenamer pressed do (
		for n in 1 to selection.count do (
			selection[n].name = selection[n].name + objSuffix
		)
	)

Best,
Pixamoon

__dkail's picture

simplified version

on btn_objRenamer pressed do 
(
	for obj in selection do
	(
		obj.name += objSuffix
	)
)
mxdsa's picture

Thank you!

Thank you!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.