pickbutton help

i wrote this test script to test different maxscript commands.
1-i want the "copy" button to be gray until i pick an object.
2-"theobject" will be clear from the memory at the start or end.
3-how can i use "theobject" variable to make action such as
copy or move?

rollout rlt_test "test"
(

pickbutton btnPick "Pick"
button btncopy "copy" enabled:false

on btnPick picked theObject do
(
btnPick.object = theObject
btnPick.caption = theObject.name + "-selected"
)

if theObject != undefined then
(
btnPick enabled:false
)
else
(
btnPick enabled:true
)
)

createDialog rlt_test 150 70

thanx

Comments

Comment viewing options

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

Great:)

Great:)

fajar's picture

rollout rlt_test

rollout rlt_test "test"
(
 
pickbutton btnPick "Pick"
button btncopy "copy" enabled:false
 
on btnPick picked theObject do
(
 
btnPick.object = theObject
 
	if (isvalidNode theObject and theObject != undefined) then
	(
			btnPick.enabled=false
			btnPick.tooltip = theObject.name + "-selected"
			btncopy.enabled=true
	)
	else
	(
		btncopy.enabled=true
	)
)
 
 
)
 
createDialog rlt_test 150 70

Comment viewing options

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