Notifications
Clear all

[Closed] Importing with no Prompt

Hi,

I have been writing a program to import USGS DEM topography data into the Max using the .DDF .DEM importer plugin, however, i’m trying to import several hundred and even though the Maxscript Reference states that using

importfile NameOfFile #noPrompt

should not give you a plugin prompt, i still get one every time. this script is doing a lot of other functions such as cleaning up the garbage data, but it still prompts me every time, and i would like to run the script overnite so i can download the entire DEM library that we have into 3D Max but i don’t want to sit there all night answering the stupid prompt. please help, thanks

5 Replies

Ok, i have found a very non-elegant way to get around this, first i made a .vbs script file that uses the sendkeys function of visual basic. bascially it sends about a hundred times the {enter} key keystroke before and after the import call so before and after every importfile call i use the shellLaunch command

so i call the
ShellLaunch “C:\Documents and Settings\jp\Desktop\sendkeys.vbs” “” command

and the sendkeys.vbs file looks like this:
‘VBScript Example
Set WshShell = WScript.CreateObject(“WScript.Shell”)

WshShell.SendKeys “{ENTER}”
WshShell.SendKeys “{ENTER}”
WshShell.SendKeys “{ENTER}”
WshShell.SendKeys “{ENTER}”
WshShell.SendKeys “{ENTER}”
WshShell.SendKeys “{ENTER}”
WshShell.SendKeys “{ENTER}”…

I’m sure there is a more elegant way of doing this, but until i find one, this will work.

 rdg

I really like this approach!
5 stars from me!

Georg

**edit
You could wrap

 WshShell.SendKeys "{ENTER}"

inside a loop.
that way the code is easier to read.

**edit

You need to run the options of the importer on the first import, and make sure it’s not set to always show option, then #noprompt should work, and the same settings will be used for the rest of the files.

how do i access the options of the importer through maxscript. its just a standard plugin that comes with MAX to import .DEM, .DDF files? thanks

You cannot access importer options from Maxscript. (AFAIK)

you should import the 1st file:
importfile f
(this will open the otions for the importer)
then import the rest of the files:
importfile f #Noprompt (import using the last settings)

another way to get/set the importer/exporter settings is to find and read/write values in itsd configuration file (usually in the plugcfg folder)

if the #NoPrompt doesn’t work, then i am clueless