Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Featured Threads
  inspiration alert!!!
(36 replies)
  Indespensible MaxScripts, Plugins and 3rd Party Tools
(37 replies)
  The allmighty FREE Resources Thread !
(17 replies)
  spam alert!!!
(4886 replies)
  Maxforums member photo gallery index
(114 replies)
  Maxforums Member Tutorials
(89 replies)
  three cheers to maxforums...
(240 replies)
  101 Things you didnt know in Max...
(198 replies)
  A Face tutorial from MDB101 :D
(95 replies) Members Gallery
(516 replies)
(637 replies)
  Dub's Maxscript Tutorial Index
(119 replies)

Maxunderground news unavailable

Simple maxscript help
show user profile  Westcoast13
I'm trying to write a dead simple script to help make my job easier! I have cad models (a LOT) that need...

1. Converting to editable poly.
2. Select all vertices.
3. Vertex welding to 0.002mm.
4. Select all polygons.
5. Auto smooth.
6. Freeze.

I am trying to write a script that allows me to select the object and click a button to run the script.

I have done a script, made a toolbar button for it (using Dubs maxscript tuts here) but it doesnt seem to work, and its my first one so i have no idea why. "Modifier Stack" "Convert_to_Poly"
subobjectLevel = 1
actionMan.executeAction 0 "40021"
$.EditablePoly.SetSelection #Vertex #{1..482}
$.weldThreshold = 0.002
subobjectLevel = 4
actionMan.executeAction 0 "40021"
$.EditablePoly.SetSelection #Face #{1..512}
$.EditablePoly.autosmooth ()
subobjectLevel = 0
actionMan.executeAction 0 "224"
freeze $

Thats what i have come up with as a script, any ideas....?

My Turbosquid Area

read 3893 times
6/25/2010 8:14:43 AM (last edit: 6/25/2010 8:14:43 AM)
show user profile  the architect
So what is the purpose of the script that you intend to create?
is it simply to select all objs, select all the objs' vertices, weld all of them to 0,02??
I think it can be done rite away by selecting all objs manually. have you tried all the usual manual ways before you start to script?
read 3859 times
6/26/2010 9:04:48 AM (last edit: 6/26/2010 9:07:13 AM)
show user profile  Dub.
try something like this:

sorry, no max at hand so it may have some bugs.

macroScript DoStuff category:"Tools" tooltip:"Do Stuff" buttontext:"Do Stuff" (
for o in selection do (
convertTo o editable_poly
addmodifier o (vertex_weld threshold:0.02)
addmodifier o (smooth autosmooth:true threshold:30)
collapseStack o
freeze o

read 3850 times
6/26/2010 10:31:20 AM (last edit: 6/26/2010 10:31:58 AM)
show user profile  Herbie
Ah Dub beat me to it...

macroScript Automate_AutoCAD
Tooltip: "Automate_AutoCAD"
Category: "Scripts"
for c in selection do
c = convertToPoly($)
polyop.setVertSelection c #all
c.weldThreshold = 0.002
c.buttonOp #weldSelected
polyop.setFaceSelection c #all
freeze c

Hope this helps...
read 3843 times
6/26/2010 11:01:33 AM (last edit: 6/26/2010 11:01:33 AM)
show user profile  Westcoast13
Thanks for the replies fella's i'll give it a go today. :)

My Turbosquid Area

read 3815 times
6/28/2010 8:44:50 AM (last edit: 6/28/2010 8:44:50 AM)
show user profile  Westcoast13
Worked a peach mate!! Thanks.

@the architect

I have models from catia, converted to .wrl they're not from autocad. The whole file is 600mb and all the parts are seperate. Selecting all at once isnt an option.

My Turbosquid Area

read 3814 times
6/28/2010 8:52:17 AM (last edit: 6/28/2010 8:52:17 AM)
show user profile  Garp
Just a late note.
If you have lots of objects/high polycount, emeshes will be easier on max than epolys.

read 3811 times
6/28/2010 9:16:06 AM (last edit: 6/28/2010 9:16:06 AM)
show user profile  Westcoast13
Cheers mate, i did notice that actually. I've just got used to working with epolys. You get stuck in your ways when you get to my age. ;)

My Turbosquid Area

read 3808 times
6/28/2010 9:54:05 AM (last edit: 6/28/2010 9:54:05 AM)
#Maxforums IRC
Open chat window