There's a very common keyword, in most programming languages, that goes through a collection of things (like the list of the selected objects): for
Now for the basic example. Let's say you want to change the radius of multiple spheres ! In MAXScript it would look like that:
for i in selection do i.radius = 5
How to know the name of the parameter I hear? Well there are a few ways.
From there you just replace radius by segs and you're set! As you can see the parameter name in MAXScript isn't always the same as the one displayed in the interface, so you can't always just guess.
$.segs = 10
Another way is to ask Max to show you the list of the attributes of the selected object with the function show:
That can come in handy! The $ sign stands for the current selection.
show $ .smooth : boolean .radius : float .segs : integer .mapcoords : boolean .slice : boolean .hemisphere : float .sliceFrom : angle .sliceTo : angle .chop : integer .recenter : boolean .realWorldMapSize : boolean false
Of course you'll also find all the properties of objects in Max Help, with some info about them if you're lucky!
Note that for a lot of basic attributes like radius ou segs, you can directly type:
That's called a Mapped Function and can be faster than a for loop, but doesn't always work. For example, if you try to assign an animation controller on several objects, you'll have to resort to using a loop.
$.segs = 10
That's it for today, it's fairly simple but can save your life from time to time !