Creating XYZ Points from Excel file (Newbie Question)

Hello All,

I have an application where I am importing XYZ coordinates and wish to do them all at once in a script so that I create points for each XYZ location.

I was thinking that the helper points would be sufficient, but could someone generate this simple repeating script?

thanks,

Eugene

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anubis's picture

If your CSV file formated:

If your CSV file formated: X, Y, Z

theFilename = getOpenFileName types:"Comma Separated Values (*.CSV)|*.CSV|All Files (*.*)|*.*"
if theFilename != undefined do ( --if a valid filename picked
    local theFile = openFile theFilename --open the file
    while not eof theFile do ( --loop until the end of file
        Point pos:(Point3 (readValue theFile) (readValue theFile) (readValue theFile))
    )
)

my recent MAXScripts RSS (archive here)

eliscio's picture

Just a bit more on this

Just a bit more on this subject...

After some bashing around with the MaxScript Listener, I was able to create a point by entering something like this:

$Point_Helper:Point01 @ [2.100000,0.000000,3.833000]

However, I have a long list of points and have to do this several times over. I have all the points in Excel and can add the necessary code there so I can simply cut and paste into Notepad to create the script.

When I pasted the whole list in the Listener it only created the point for the last line.

Thanks again!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.