Limited Add Button

Hi,

I created a dialogue in 3ds max by script. I'd like to know how to create a limited add view button, let say five views.

Thnx in advance,

Marc

Comments

Comment viewing options

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

I tried this script and I

I tried this script and I found an error on this line:

try(destroyDialog rol_test)catch()
Thank you in advance

:) Marc

barigazy's picture

Works well. How could you

Works well. How could you find an error on second line. Except you forgef to paste parentheses like in the code that Kostadin post below.
Also you can remove the line "global rol_test" and use simply
try(destroyDialog ::rol_test)catch()

bga

Marc_or's picture

Hi, Yes it's working now,

Hi,

Yes it's working now, cause I restarted max 2013 and checked it once again.

miauu's picture

Something like this?

(
	global rol_test
	try(destroyDialog rol_test)catch()
	rollout rol_test ""
	(
		local viewCount = 1
 
		button btn_addLimited "Add"
 
		on btn_addLimited pressed do
		(
			if viewCount <= 5 do
			(
				format "Add view: % \n" viewCount
				viewCount += 1	--	increment the counter with 1
			)
		)
 
	)
	createdialog rol_test 
)

Change the script to fit your needs.

Marc_or's picture

Thanks for your answer:) I'm

Thanks for your answer:)

I'm gonna check it in my script ;)

Comment viewing options

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