Scripting batch import of point files

Next
 From:  bemfarmer
9756.1 
HI Michael

The script ImportPointFile works well for manually importing a point file in X Y Z space delimited format.

Do you have any tips for importing 4 files in the point format, in a script?

I can do an .htm file, which would include prompts:
"Import Curve A"
"Import Curve B"
"Import Curve C"
"Import Curve D"

Options:
Delimiter: "Space"
Import as: "Through points"
Curve end: "Open"

(I did have a look at Batch Convert.)

# include "ImportPointFile.js" ?

Thank you,
- Brian

I also want to name the curves... can probably find some examples of how to do this...
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9756.2 In reply to 9756.1 
Hi Brian, the batch convert is for doing a silent conversion of everything in a folder instead of prompting for files.

It sounds like you want to make a command that will put up 4 prompts to pick 4 filenames? If so then there isn't much applicable from the Batch convert code.

The main code you would want to focus on is the ImportPointFile script from: http://kyticka.webzdarma.cz/3d/moi/#ImportPointFile and you'll want the one that says was updated for OSX, even if you're on Windows. That's the one that uses the newer built in MoI file stream reader.

You'd want to do something like modify the ImportPointFile() function so that it returns back the curve and takes a function argument for the file name prompt. Then instead of just calling that function once at the bottom of the script like it currently does, you'd make a loop that calls that updated function 4 times. Let me know if you're stuck.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  bemfarmer
9756.3 In reply to 9756.2 
Thank you Michael for the tips, info, and clarifications.

I'll have a go at it.

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All