Maxscript Extrude.

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  02 February 2005
Maxscript Extrude.

Hi,

Im new to the maxscripting world so you might have to bear with me.

Anyway Im trying to write a small script that will extrude imported shapes from autocad at a random height.

So far I have this:

----

global rExtrudeLowerLimit=1.0

global rExtrudeUpperLimit=10.0



modPanel.addModToSelection (Extrude ()) ui:
on

$.modifiers[#Extrude].amount = (random rExtrudeLowerLimit rExtrudeUpperLimit)

----

Now the problem is, this works fine if i have selected 1 shape. If i want to extrude multiple shapes all at random heights, it doesnt work. Now i can sort of understand in my head why, however I wouldnt have a clue how to rectify this.

The next step Im hoping to work out is to then 'drape' those extruded shapes onto a surface but first things first, the extrude is my main priority at this stage.

I figure this is a relatively simple operation but as i said, Im new.

Any help would be greatly appreciated!

Ah lastly, before you say to search the help files, Im using VIZ and there doesnt seem to be any maxscript help in the helpfiles.

Cheers for any help you can provide!
 
  02 February 2005
bobo posted a link to the max7 maxscript help file:
ftp://ftp.discreet.com/pub2/web/pro...pdated_help.exe

im using max6, i cud still use that helpfile coz it indicates entries that are new to max7, plus, the readability has improved, lots of new samples, and stuff, excellent resource.

im not sure if viz also has a separate help file for maxscript, but usually they come in seperate files.. a file for max, maxscript, character studio, and reactor... have tried looking at the max root folder under help (c:\3dsmax\help)? im not really particular with how or where viz installs its directories, but im just just assuming that its basically the same..

best bet is to look for "for loops"
very simple example...

for i in 1 to 10 do
(
print i
)


prints the numbers 1 to 10 in the listener...

hope this helps!
 
  02 February 2005
to help you:

for obj in selection do
	(
	addmodifier obj (Extrude ()) -- each modifier will be different
	obj.modifiers[#Extrude].amount = (random rExtrudeLowerLimit rExtrudeUpperLimit)
	)
 
  02 February 2005
Fantastic,


I found the help file (was looking in the wrong spot) and both those examples have helped me.

Thanks very much
 
  07 July 2005
i had the same need ..

i was just typing
for obj in selection do addmodifier obj (Extrude ())
OK

and then

for obj in selection do obj.modifiers[#Extrude].amount=(random WhateverLow WhateverHigh)
OK


the strange thing is that when i combined those two into one command, and tried to do the same, it failed ... and such a simple command .

Maybe it has something to do with some problems in autocad files, (unclosed polylines for example) , or maybe something else .

But i do not really know .

When i will have some time i will try to post the final version.. :-)

Last edited by krembo99 : 07 July 2005 at 12:26 PM.
 
  07 July 2005
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:13 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.