Notifications
Clear all

[Closed] Maxscript–Question about " items:("","") "

Hello folks !

I have a question about the "items" parameter.
I want to refresh a listbox after clicking on a button. But i don't know if "items:" in
-- Listbox listb "List :" items: -- is use only on creating the listbox or can be edited later.

I put a for loop in the items like

-- items:(for f in 1 to objects collect f.length) --

That works the for loop get lengthes and put them in the listbox. But if i create a new box how to refresh the list to have the length of the new box too ?

Could you help me ?

7 Replies

There’s a “how to” example in the MAXScript reference titled “How do I update the items in a dropdownList or listBox?” that explain exactly what you are looking for. Here’s a snip of code:

--Because insertItem returns OK instead of the resulting array,
--you cannot assign the result of the expression directly to the property.
--Instead, you have to get a copy of the items array in a local variable...
temp_array = testList.items
--...perform the insertion with the temp. array in the local variable...
insertItem ("Item "+ (testList.items.count+1) as string) temp_array testList.selection 
--...and assign back the temp. array to the .items property
testList.items = temp_array

Hope that helps.

Hello Halfvector.

I don’t believe it.
I have the maxscript reference open and i didn’t see it :p.

Thanks a lot for your help. :buttrock:

Yeah, sometimes is hard to find what you are looking for!

Oh yes i found it.

Maxscript it’s a big book with a lot of pages very very hidden.
I don’t understand why they don’t put this “how to” in how to list. Very strange :curious:

No it’s not a “how to” but a “how do”.
There is the explication

My bad.

Back in R5 when I started editing the Reference, I added a bunch of Tutorials under the chapter “How To… Practical Examples”.

Then in a later update, I added a Frequently Asked Questions chapter and in order to avoid mixing the How To tutorials with the FAQ, most of the FAQ entries were named “How Do I…”.

In general, I would suggest reading ALL FAQ entries, even if you don’t need them today. This will give you an idea what FAQs have been asked and answered and next time you need a common workaround or specific detail, you will probably remember vaguely reading about it and will look again.

In the mean time, I will make sure that ALL FAQs are back-linked from the topics they relate to…

Hello Borislav.

Thanks for your suggestion. i’ll make it.
It’s my fault because i am totally lost in mascript reference. I don’t know why
i can’t read it properly.

I don’t know you have write it