how to short this script ?

Hello again,

Sorry i'have an other question (but believe me i search a lot before asking)

I'm sure that it's easy but i can't find the right grammar.
I would like to add a variable into a variable name
Like

I mean i would like to be able to add variable into the an other variable name like

for i = 1 to 5 do (
var_number_[i] = "hello"
)
print var_number_1
print var_number_2
print var_number_3

In my case i've that to short

macroscript Light category:"gabi"
 (
 
			rollout lumiere "Gestion de light"
			(
	group "Group"
		(
		radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
		)
button ajout "Add selection to group" width:210 height:25 align:#center
On ajout pressed do
				(
 
					if groupe.state == 1 do
					(
				sel_courante = selection as array
				lum1 = lum1 + sel_courante
				makeUniqueArray (lum1)
				utilitaire = for s in lum1 collect s.name
				liste_lum1.items = utilitaire
 
					)
				if groupe.state == 2 do
					(
				sel_courante = selection as array
				lum2 = lum2 + sel_courante
				makeUniqueArray (lum2)
				utilitaire = for s in lum2 collect s.name
				liste_lum2.items = utilitaire
					)
						if groupe.state == 3 do
					(
				sel_courante = selection as array
				lum3 = lum3 + sel_courante
				makeUniqueArray (lum3)
				utilitaire = for s in lum3 collect s.name
				liste_lum3.items = utilitaire
					)
						if groupe.state == 4 do
					(
				sel_courante = selection as array
				lum4 = lum4 + sel_courante
				makeUniqueArray (lum4)
				utilitaire = for s in lum4 collect s.name
				liste_lum4.items = utilitaire
					)
 
			)
	)
createdialog lumiere width:600 height:600
)

And i would like to do something like that

macroscript Light category:"gabi"
 (
 
			rollout lumiere "Gestion de light"
			(
	group "Group"
		(
		radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
		)
button ajout "Add selection to group" width:210 height:25 align:#center
On ajout pressed do
	(
sel_courante = selection as array
				lum[group.state] = lum[group.state] + sel_courante
				makeUniqueArray(lum[group.state])
				utilitaire = for s in lum[group.state] collect s.name
				liste_lum[group.state].items = utilitaire
)
)
createdialog lumiere width:600 height:600
)

thank for any help

Comments

Comment viewing options

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

Try this script. Tested on

Try this script. Tested on max2009 and there is no need to select the lights to turn them On or OFF.
In the new script(posted as code in your last post) I added

button active "Activer le groupe"

but don't know if it has to works as in my code.

Also, I don't know what the
button ajout "Ajouter Selection au groupe"
have to do in the new script.

-- macroscript yo category:"HowTO" 
(
 
	rollout lumiere "Gestion de light"
	(		
		groupbox grp_lum1 "Jeux de lumiere 1 " width:270 height:160 pos:[20,40]
 
		dropdownlist lum1_1 "" lum1_1:#()  width:175 pos: [ 35, 65] 
		dropdownlist lum1_2 ""  lum1_2:#()  width:175  pos: [ 35, 90]
		dropdownlist lum1_3 ""  lum1_3:#()  width:175 pos: [35, 115]
		dropdownlist lum1_4 ""  lum1_4:#()  width:175 pos: [35, 140]
		checkbox a_lum1_1 "On" pos:[215,65]
		checkbox a_lum1_2 "On" pos:[215,90]
		checkbox a_lum1_3 "On" pos:[215,115]
		checkbox a_lum1_4 "On" pos:[215,140]
		button aj_lum1_1 "Add" width: 30 height: 17 pos: [ 250, 65]
		button aj_lum1_2 "Add" width: 30 height: 17 pos: [ 250, 90]
		button aj_lum1_3 "Add" width: 30 height: 17 pos: [ 250, 115]
		button aj_lum1_4 "Add" width: 30 height: 17 pos: [ 250, 140]
		button main_lum1_1 "Activer Jeux 1" width: 100 height: 20 pos: [35, 170]
 
		groupbox grp_lum2 "Jeux de lumiere 2 " width:270 height:160 pos:[300,40]
 
		dropdownlist lum2_1 ""  lum2_1:#()  width:175 pos: [ 315, 65]
		dropdownlist lum2_2 ""  lum2_2:#()  width:175  pos: [ 315, 90]
		dropdownlist lum2_3 ""  lum2_3:#()  width:175 pos: [315, 115]
		dropdownlist lum2_4 ""  lum2_4:#()  width:175 pos: [315, 140]
		checkbox a_lum2_1 "On" pos:[495,65]
		checkbox a_lum2_2 "On" pos:[495,90]
		checkbox a_lum2_3 "On" pos:[495,115]
		checkbox a_lum2_4 "On" pos:[495,140]
		button aj_lum2_1 "Add" width: 30 height: 17 pos: [ 530, 65]
		button aj_lum2_2 "Add" width: 30 height: 17 pos: [ 530, 90]
		button aj_lum2_3 "Add" width: 30 height: 17 pos: [ 530, 115]
		button aj_lum2_4 "Add" width: 30 height: 17 pos: [ 530, 140]
		button main_lum2_1 "Activer Jeux 2" width: 100 height: 20 pos: [315, 170]
 
		groupbox grp_lum3 "Jeux de lumiere 3 " width:270 height:160 pos:[20,210]
 
		dropdownlist lum3_1 ""  lum3_1:#()  width:175 pos: [ 35, 235]
		dropdownlist lum3_2 ""  lum3_2:#()  width:175  pos: [ 35, 260]
		dropdownlist lum3_3 ""  lum3_3:#()  width:175 pos: [35, 285]
		dropdownlist lum3_4 ""  lum_4:#()  width:175 pos: [35, 310]
		checkbox a_lum3_1 "On" pos:[215,235]
		checkbox a_lum3_2 "On" pos:[215,260]
		checkbox a_lum3_3 "On" pos:[215,285]
		checkbox a_lum3_4 "On" pos:[215,310]
		button aj_lum3_1 "Add" width: 30 height: 17 pos: [ 250, 235]
		button aj_lum3_2 "Add" width: 30 height: 17 pos: [ 250, 260]
		button aj_lum3_3 "Add" width: 30 height: 17 pos: [ 250, 285]
		button aj_lum3_4 "Add" width: 30 height: 17 pos: [ 250, 310]
		button main_lum3_1 "Activer Jeux 1" width: 100 height: 20 pos: [35, 170]
 
		groupbox grp_lum4 "Jeux de lumiere 4 " width:270 height:160 pos:[300,210]
 
		dropdownlist lum4_1 ""  lum4_1:#()  width:175 pos: [ 315, 235]
		dropdownlist lum4_2 ""  lum4_2:#()  width:175  pos: [ 315, 260]
		dropdownlist lum4_3 ""  lum4_3:#()  width:175 pos: [315, 285]
		dropdownlist lum4_4 ""  lum4_4:#()  width:175 pos: [315, 310]
		checkbox a_lum4_1 "On" pos:[495,235]
		checkbox a_lum4_2 "On" pos:[495,260]
		checkbox a_lum4_3 "On" pos:[495,285]
		checkbox a_lum4_4 "On" pos:[495,310]
		button aj_lum4_1 "Add" width: 30 height: 17 pos: [ 530, 235]
		button aj_lum4_2 "Add" width: 30 height: 17 pos: [ 530, 260]
		button aj_lum4_3 "Add" width: 30 height: 17 pos: [ 530, 285]
		button aj_lum4_4 "Add" width: 30 height: 17 pos: [ 530, 310]
		button main_lum4_1 "Activer Jeux 2" width: 100 height: 20 pos: [315, 170]
 
		radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2 pos: [ 20, 400]
 
		button ajout "Ajouter Selection au groupe" width:210 height:25 align:#center
		button active "Activer le groupe" width:210 height:25 align:#center	
 
 
	-- The function ajouter should add selected obj to a dropdownlist										
		fn ajouter list = 
		(  -- The ajouter function have two variables: AJ = (for example l1_1) and LIST = (for example lum1_1) the dropdown name  
			--	get the curent ddl items - light names
			aj = list.items
			sel_courante = for s in (selection ) collect s.name
			--	for some raeason makeUniqueArray aj not work properly for me in this function
			for s in sel_courante do (appendIfUnique aj s)
			list.items = aj 
		)
		fn chang ddl state = 
		( --This function turn On or OFF the lights 
			--	ddl is list of lights names stored in the approriate dll.
			--	To get the real light in the scene and turn them on or off use getNodeByName.	
			for v in ddl.items do (getNodeByName v).on = state
		)
 
		function TurnONOFFGroups ddlOFF ddlON  =
		(
			for d in ddlOFF do
			(
				for l in d.items where (isValidNode (ll = (getNodeByName l)) ) do ll.on = off
			)
 
			for d in ddlON do
			(
				for l in d.items where (isValidNode (ll = (getNodeByName l)) ) do ll.on = on
			)			
		)
 
		on aj_lum1_1 pressed do 	(ajouter lum1_1)
		on aj_lum1_2 pressed do 	(ajouter lum1_2)		
		on aj_lum1_3 pressed do 	(ajouter lum1_3)				
		on aj_lum1_4 pressed do 	(ajouter lum1_4)		
		on aj_lum2_1 pressed do 	(ajouter lum2_1)
		on aj_lum2_2 pressed do 	(ajouter lum2_2)		
		on aj_lum2_3 pressed do 	(ajouter lum2_3)				
		on aj_lum2_4 pressed do 	(ajouter lum2_4)	
		on aj_lum3_1 pressed do 	(ajouter lum3_1)
		on aj_lum3_2 pressed do 	(ajouter lum3_2)		
		on aj_lum3_3 pressed do 	(ajouter lum3_3)				
		on aj_lum3_4 pressed do 	(ajouter lum3_4)	
		on aj_lum4_1 pressed do 	(ajouter lum4_1)
		on aj_lum4_2 pressed do 	(ajouter lum4_2)		
		on aj_lum4_3 pressed do 	(ajouter lum4_3)				
		on aj_lum4_4 pressed do 	(ajouter lum4_4)	
 
		on a_lum1_1 changed checkboxState3 do chang lum1_1 checkboxState3
		on a_lum1_2 changed checkboxState3 do chang lum1_2 checkboxState3
		on a_lum1_3 changed checkboxState3 do chang lum1_3 checkboxState3
		on a_lum1_4 changed checkboxState3 do chang lum1_4 checkboxState3
		on a_lum2_1 changed checkboxState3 do chang lum2_1 checkboxState3
		on a_lum2_2 changed checkboxState3 do chang lum2_2 checkboxState3
		on a_lum2_3 changed checkboxState3 do chang lum2_3 checkboxState3
		on a_lum2_4 changed checkboxState3 do chang lum2_4 checkboxState3
		on a_lum3_1 changed checkboxState3 do chang lum3_1 checkboxState3
		on a_lum3_2 changed checkboxState3 do chang lum3_2 checkboxState3
		on a_lum3_3 changed checkboxState3 do chang lum3_3 checkboxState3
		on a_lum3_4 changed checkboxState3 do chang lum3_4 checkboxState3
		on a_lum4_1 changed checkboxState3 do chang lum4_1 checkboxState3
		on a_lum4_2 changed checkboxState3 do chang lum4_2 checkboxState3
		on a_lum4_3 changed checkboxState3 do chang lum4_3 checkboxState3
		on a_lum4_4 changed checkboxState3 do chang lum4_4 checkboxState3
 
		on active pressed do 
		(
			if groupe.state == 1 do
			(
				--	I supposed you want to turn ON all lights in lum1_1, lum2_1, lum3_1, lum4_1
				--	and turn OFF all lights in the other ddls. If you have lights, common, for example, for
				-- lum3_1 and lum3_2, these lights will be first turned OFF and then turned ON
 
				--	create arrays with dropdownlist controls
				ddlOFF = #(lum1_2, lum1_3, lum1_4, lum2_2, lum2_3, lum2_4, lum3_2, lum3_3, lum3_4, lum4_2, lum4_3, lum4_4)
				ddlON = #(lum1_1, lum2_1, lum3_1, lum4_1)
 
				TurnONOFFGroups ddlOFF ddlON
			)
 
			if groupe.state == 2 do
			(
				ddlOFF = #(lum1_1, lum1_3, lum1_4, lum2_1, lum2_3, lum2_4, lum3_1, lum3_3, lum3_4, lum4_1, lum4_3, lum4_4)
				ddlON = #(lum1_2, lum2_2, lum3_2, lum4_2)
 
				TurnONOFFGroups ddlOFF ddlON
			)
 
			if groupe.state == 3 do
			(
				ddlOFF = #(lum1_1, lum1_2, lum1_4, lum2_1, lum2_2, lum2_4, lum3_1, lum3_2, lum3_4, lum4_1, lum4_2, lum4_4)
				ddlON = #(lum1_3, lum2_3, lum3_3, lum4_3)
 
				TurnONOFFGroups ddlOFF ddlON
			)
			if groupe.state == 4 do
			(
				ddlOFF = #(lum1_1, lum1_2, lum1_3, lum2_1, lum2_2, lum2_3, lum3_1, lum3_2, lum3_3, lum4_1, lum4_2, lum4_3)
				ddlON = #(lum1_4, lum2_4, lum3_4, lum4_4)
 
				TurnONOFFGroups ddlOFF ddlON
			)		 
		)
 
	)
	createdialog lumiere width:700 height:600
) -- end utility MyUtil
Gabi's picture

hell yeah !

Thank you a lot for the time you passed on !

Everything works fine !

The button "ajout "Ajouter Selection au groupe" is a old part of the script i forgot to delete.

I learn a lot from you correction (especially with getNodeByName )
Now i'm gonna add some stuff (rename groups button, save data to max scene ect...)

Thank again.

Gabi's picture

euh...

Your script worked fine but it's was not enough.
Hard to explain, i don't speak english very well.

In fact i used variable lum1, lum2, lum 3 ect... after for an other part (a button which enable or disabel lights)

button active "Activer le groupe" width:210 height:25 
radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
 
 
 On active pressed do (
			if groupe.state == 1 do
			(
clearSelection()
select (lum2 + lum3 + lum4)
for v in $ do 
(v.multiplier = 0)
 
		)

Variables lum? store informations (in a array ?) of which object are in groups.

I can't manage to do the same things from information store in drop down list. (but i'm pretty sure that's it's possible)

In an other part i changed the interface of the script (become more complicated)

OLD VERSION => http://nsa32.casimages.com/img/2012/11/03/121103080215710694.jpg

NEW VERSION => http://nsa32.casimages.com/img/2012/11/03/121103080021180086.jpg

(juste fin case i put the script of the old one (it's worked but
style heavy code and useless (i put in txt to short the post)
OLD SCRIPT http://textup.fr/32631Q0

The script become different. You're way worked for a single one button. but i have now plenty off "Add" button.
So i tried to create some functions.

(i add somme note to explain the mess)

macroscript yo category:"HowTO" (
 
			rollout lumiere "Gestion de light"
			(
		local lum1 = #()
		local lum2 = #()
		local lum3 = #()
		local lum4 = #()
		local test = #()
		local l1_1 = #()
		local l1_2 = #()
		local l1_3 = #()
		local l1_4 = #()
		local l2_1 = #()
		local l2_2 = #()
		local l2_3 = #()
		local l2_4 = #()			
		local l3_1 = #()
		local l3_2 = #()
		local l3_3 = #()
		local l3_4 = #()	
		local l4_1 = #()
		local l4_2 = #()
		local l4_3 = #()
		local l4_4 = #()
		local aj = #()
 
 
 
	groupbox grp_lum1 "Jeux de lumiere 1 " width:270 height:160 pos:[20,40]
 
 
			dropdownlist lum1_1 "" lum1_1:#()  width:175 pos: [ 35, 65]
 
			dropdownlist lum1_2 ""  lum1_2:#()  width:175  pos: [ 35, 90]
			dropdownlist lum1_3 ""  lum1_3:#()  width:175 pos: [35, 115]
			dropdownlist lum1_4 ""  lum1_4:#()  width:175 pos: [35, 140]
			checkbox a_lum1_1 "On" pos:[215,65]
			checkbox a_lum1_2 "On" pos:[215,90]
			checkbox a_lum1_3 "On" pos:[215,115]
			checkbox a_lum1_4 "On" pos:[215,140]
			button aj_lum1_1 "Add" width: 30 height: 17 pos: [ 250, 65]
			button aj_lum1_2 "Add" width: 30 height: 17 pos: [ 250, 90]
			button aj_lum1_3 "Add" width: 30 height: 17 pos: [ 250, 115]
			button aj_lum1_4 "Add" width: 30 height: 17 pos: [ 250, 140]
			button main_lum1_1 "Activer Jeux 1" width: 100 height: 20 pos: [35, 170]
 
 
	groupbox grp_lum2 "Jeux de lumiere 2 " width:270 height:160 pos:[300,40]
 
 
			dropdownlist lum2_1 ""  lum2_1:#()  width:175 pos: [ 315, 65]
			dropdownlist lum2_2 ""  lum2_2:#()  width:175  pos: [ 315, 90]
			dropdownlist lum2_3 ""  lum2_3:#()  width:175 pos: [315, 115]
			dropdownlist lum2_4 ""  lum2_4:#()  width:175 pos: [315, 140]
			checkbox a_lum2_1 "On" pos:[495,65]
			checkbox a_lum2_2 "On" pos:[495,90]
			checkbox a_lum2_3 "On" pos:[495,115]
			checkbox a_lum2_4 "On" pos:[495,140]
			button aj_lum2_1 "Add" width: 30 height: 17 pos: [ 530, 65]
			button aj_lum2_2 "Add" width: 30 height: 17 pos: [ 530, 90]
			button aj_lum2_3 "Add" width: 30 height: 17 pos: [ 530, 115]
			button aj_lum2_4 "Add" width: 30 height: 17 pos: [ 530, 140]
			button main_lum2_1 "Activer Jeux 2" width: 100 height: 20 pos: [315, 170]
 
 
	groupbox grp_lum3 "Jeux de lumiere 3 " width:270 height:160 pos:[20,210]
 
 
			dropdownlist lum3_1 ""  lum3_1:#()  width:175 pos: [ 35, 235]
			dropdownlist lum3_2 ""  lum3_2:#()  width:175  pos: [ 35, 260]
			dropdownlist lum3_3 ""  lum3_3:#()  width:175 pos: [35, 285]
			dropdownlist lum3_4 ""  lum_4:#()  width:175 pos: [35, 310]
			checkbox a_lum3_1 "On" pos:[215,235]
			checkbox a_lum3_2 "On" pos:[215,260]
			checkbox a_lum3_3 "On" pos:[215,285]
			checkbox a_lum3_4 "On" pos:[215,310]
			button aj_lum3_1 "Add" width: 30 height: 17 pos: [ 250, 235]
			button aj_lum3_2 "Add" width: 30 height: 17 pos: [ 250, 260]
			button aj_lum3_3 "Add" width: 30 height: 17 pos: [ 250, 285]
			button aj_lum3_4 "Add" width: 30 height: 17 pos: [ 250, 310]
			button main_lum3_1 "Activer Jeux 1" width: 100 height: 20 pos: [35, 170]
 
		groupbox grp_lum4 "Jeux de lumiere 4 " width:270 height:160 pos:[300,210]
 
 
			dropdownlist lum4_1 ""  lum4_1:#()  width:175 pos: [ 315, 235]
			dropdownlist lum4_2 ""  lum4_2:#()  width:175  pos: [ 315, 260]
			dropdownlist lum4_3 ""  lum4_3:#()  width:175 pos: [315, 285]
			dropdownlist lum4_4 ""  lum4_4:#()  width:175 pos: [315, 310]
			checkbox a_lum4_1 "On" pos:[495,235]
			checkbox a_lum4_2 "On" pos:[495,260]
			checkbox a_lum4_3 "On" pos:[495,285]
			checkbox a_lum4_4 "On" pos:[495,310]
			button aj_lum4_1 "Add" width: 30 height: 17 pos: [ 530, 235]
			button aj_lum4_2 "Add" width: 30 height: 17 pos: [ 530, 260]
			button aj_lum4_3 "Add" width: 30 height: 17 pos: [ 530, 285]
			button aj_lum4_4 "Add" width: 30 height: 17 pos: [ 530, 310]
			button main_lum4_1 "Activer Jeux 2" width: 100 height: 20 pos: [315, 170]
 
 
 
 
 
		radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2 pos: [ 20, 400]
 
 
			button ajout "Ajouter Selection au groupe" width:210 height:25 align:#center
			button active "Activer le groupe" width:210 height:25 align:#center	
 
 
-- The function ajouter should add selected obj to a dropdownlist										
fn ajouter aj list = (                        -- The ajouter function have two variables: AJ = (for example l1_1) and LIST = (for example lum1_1) the dropdown name 
 
sel_courante = selection as array     -- sel_courante means curent selection - Object which are selected
aj = aj + sel_courante
	makeUniqueArray (aj)					
utilitaire = for s in aj collect s.name -- utilitaire is like foo
list.items = utilitaire 
 
				)
 
fn acti var = (      -- This funtion should select lights and enable them
clearSelection()
var as array
select (var)
for v in $ do 
(v.on = on)
		)
fn ina var = (   -- This funtion should select lights and disable them
clearSelection()
select (var)
for v in $ do 
(v.on = off)
		)
 
fn chang foo avar = ( --This function decide if enable or disable lights
				case of
				(
					(avar.state == true) : (acti foo)
					(avar.state == false) : (ina foo)
				)
			)
 
on aj_lum1_1 pressed do 	(ajouter l1_1 lum1_1)
on aj_lum1_2 pressed do 	(ajouter l1_2 lum1_2)		
on aj_lum1_3 pressed do 	(ajouter l1_3 lum1_3)				
on aj_lum1_4 pressed do 	(ajouter l1_4 lum1_4)	
on aj_lum2_1 pressed do 	(ajouter l2_1 lum2_1)
on aj_lum2_2 pressed do 	(ajouter l2_2 lum2_2)		
on aj_lum2_3 pressed do 	(ajouter l2_3 lum2_3)				
on aj_lum2_4 pressed do 	(ajouter l2_4 lum2_4)	
on aj_lum3_1 pressed do 	(ajouter l1_1 lum3_1)
on aj_lum3_2 pressed do 	(ajouter l3_2 lum3_2)		
on aj_lum3_3 pressed do 	(ajouter l3_3 lum3_3)				
on aj_lum3_4 pressed do 	(ajouter l3_4 lum3_4)	
on aj_lum4_1 pressed do 	(ajouter l4_1 lum4_1)
on aj_lum4_2 pressed do 	(ajouter l4_2 lum4_2)		
on aj_lum4_3 pressed do 	(ajouter l4_3 lum4_3)				
on aj_lum4_4 pressed do 	(ajouter l4_4 lum4_4)					
 
 
 
 
on a_lum1_1 changed checkboxState3 do chang l1_1 a_lum1_1
on a_lum1_2 changed checkboxState3 do chang l1_2 a_lum1_2
on a_lum1_3 changed checkboxState3 do chang l1_3 a_lum1_3
on a_lum1_4 changed checkboxState3 do chang l1_4 a_lum2_4
on a_lum2_1 changed checkboxState3 do chang l2_1 a_lum2_1
on a_lum2_2 changed checkboxState3 do chang l2_2 a_lum2_2
on a_lum2_3 changed checkboxState3 do chang l2_3 a_lum2_3
on a_lum2_4 changed checkboxState3 do chang l2_4 a_lum2_4
on a_lum3_1 changed checkboxState3 do chang l3_1 a_lum3_1
on a_lum3_2 changed checkboxState3 do chang l3_2 a_lum3_2
on a_lum3_3 changed checkboxState3 do chang l3_3 a_lum3_3
on a_lum3_4 changed checkboxState3 do chang l3_4 a_lum3_4
on a_lum4_1 changed checkboxState3 do chang l4_1 a_lum4_1
on a_lum4_2 changed checkboxState3 do chang l4_2 a_lum4_2
on a_lum4_3 changed checkboxState3 do chang l4_3 a_lum4_3
on a_lum4_4 changed checkboxState3 do chang l4_4 a_lum4_4
 
		)
 
 
 
 
 
 
 
createdialog lumiere width:700 height:600
) -- end utility MyUtil

Issue:
The function to add to a list work. But doesn't store information
On new selection it's erase old selection.

The function to turn light on/off doesn't work at all because can't find back the object previously selected.

I don't find a way to enable/disable lights without selected then in 3Ds max view... Cause it's work so i don't don't search an other way 'cause i'm laisy. but i'm sure it's easy

I can make the script work but with the old heeeeeeavy code style.

If somebody read me, thank you a lot because it's take time.

Gabi

miauu's picture
Gabi's picture

ok thank you !

ok thank you !

miauu's picture

Try this:

( 
	rollout lumiere "Gestion de light"
	(
		group "Group"
		(
			radiobuttons groupe labels:#("G1","G2","G3","G4") columns:2
		)
		button ajout "Add selection to group" width:210 height:25 align:#center
		On ajout pressed do
		(
			sel_courante = selection as array
			lum = lum + sel_courante
			makeUniqueArray lum
			utilitaire = for s in lum collect s.name
			case group.state of
			(
				1: liste_lum1.items = utilitaire
				2: liste_lum2.items = utilitaire
				3: liste_lum3.items = utilitaire
				4: liste_lum4.items = utilitaire
			)
		)
	)
	createdialog lumiere width:600 height:600
)

Comment viewing options

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