Sweep modifer from textfile
Hi, I am a novice at MXS but I have picked up some bits and bobs to try and mash what I would like to do.
I have a series of objects that are in a spreadsheet, it produces a text file with a delimiter of "|" with the line name in the first and the name of the custom object in the fourth column I would like to read in all modifications required to the lines.
So far I have this however Max is unable to converts the custom object name to a MaxObject.
n = "C:\\test\\07_Max\\macros\\test.txt" f = openfile n mode:"r" count = 0 while not eof f do ( l = readline f data = filterstring l "|" beamz = line name:(data) beamtype = line name:(data) select beamz for index = beamz.modifiers.count to 1 by -1 do if ((classOf beamz.modifiers[index]) == Sweep) do deleteModifier beamz index sw=sweep() -- create an Edit Mesh modifier addModifier beamz sw -- add edit mesh mod select beamz -- select object box01 beamz.modifiers[#Sweep].CustomShape = 1 beamz.modifiers[#Sweep].XOffset = 0 beamz.modifiers[#Sweep].yOffset = 0 beamz.modifiers[#Sweep].MirrorXZPlane = off beamz.modifiers[#Sweep].shapes = (data) beamz.modifiers[#Sweep].PivotAlignment = 5 beamz.modifiers[#Sweep].Banking = off ) \<code> I then would like to change the line name to the data & data & text. If someone could give a few pointers I would grateful, thank you.