print selected object name

what i want max to do is to print the selected object name every time i select one object/change selection

but i cant figure out how to do it..
any insights?

Comments

Comment viewing options

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

In MAXScript you can use a

In MAXScript you can use a callback for this. It is a routine that will react to certain events and execute something, e.g. a function.

--function that will print out selected object names:
fn printSelName=
(
	for s in selection do print s.name
)--end fn
 
--add the callback that executes the function:
callbacks.addScript #selectionSetChanged "printSelName()" id:#myCallbackID
 
--see if your callback has been registered:
callbacks.show()
 
--remove your callback by ID:
callbacks.removeScripts #selectionSetChanged id:#myCallbackID

Cheers

Never get low & slow & out of ideas

mjbg's picture

Thank you very much.. exactly

Thank you very much..
exactly what i needed

Comment viewing options

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