help with simple section script

help with simple section script

YVESMOREAU2311
Advocate Advocate
311 Views
4 Replies
Message 1 of 5

help with simple section script

YVESMOREAU2311
Advocate
Advocate
Hello,

i am looking for a very simple script that does the "section" command (to create a new shape everytime) every X meters on the Z axis.
Can anyone help me ?

Thanks!

/muoto
0 Likes
312 Views
4 Replies
Replies (4)
Message 2 of 5

Steve_Curley
Mentor
Mentor
There's an example of this in the MaxScript help. Search for "section" - it's the 5th entry down in the results.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 5

YVESMOREAU2311
Advocate
Advocate
Hello !

Great! Now, this script makes the contours of a sphere. How do i change this to the current select object ?




meshSelected = sphere() -- object to create contours of
minZ = meshSelected.min.z -- get min and max Z positions
maxZ = meshSelected.max.z
numLevels = 10 -- the number of contours
delta = (maxZ - minZ) / (numLevels + 1) -- the number of steps
for currentZ = minZ to maxZ by delta do -- start loop...
(
s = section pos: -- create Section
max views redraw -- this line is needed to get around the problem
convertToSplineShape s -- convert Section to SplineShape
s.renderable = true -- set to renderable
)
0 Likes
Message 4 of 5

Steve_Curley
Mentor
Mentor
Replace
meshSelected = sphere()

with
meshSelected = $

Make sure you only have 1 object selected when you run it.

Tip - always post script in code tags - the forum display can really mess with code if you don't, making it impossible to copy/paste (unless you do a "quote" to get at the underlying text).

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 5

YVESMOREAU2311
Advocate
Advocate
ok Tkanks a lot.

Sorry for the quotes ! 😉
0 Likes