ScriptSpot

Forum topic · General Scripting

print selected object name

By mjbg · 2011-07-12

Description

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 (2)

br0t · 2011-07-12

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

mjbg · 2011-07-12

Thank you very much..
exactly what i needed