December 17, 2012

The Infamous FILEDIA System Variable

Here at Ideate, one of the common issues we hear about while on tech support is that a customer is not able to use a dialog box to select files for opening. In these cases, rather than seeing the dialog box, they are prompted to manually enter the full file path and name of the drawing or file they want to open at the command line.
 

The solution for this is almost always the same, and is relatively easy. Set the FILEDIA system variable to “1” instead of “0.” This system variable controls whether or not the application uses the dialog box function for file selection. 

What do “0” and “1” mean?
(Courtesy of AutoCAD Help file)

0 - Does not display dialog boxes. You can still request a file dialog box to appear by entering a tilde (~) in response to the Command prompt.

1 - Displays dialog boxes. However, if a script is active, an ordinary prompt is displayed. Prompts are also displayed if an AutoLISP or ObjectARX™ program is active. (Not applicable to AutoCAD LT.)


So what causes the value to change to 0? 
In most cases, we’ve noticed that the system variable tends to reset when a file crashes during closing, or when the application runs into an error during shut down or saving. When that happens, FILEDIA changes back to “0,” and the next time you try to open a file, you’re prompted to enter a file name and path rather than select. To fix the problem, either launch a new drawing, or double click on an existing drawing to get to the command line and type in FILEDIA to set it back to “1.” 
 

Why do we need a “0” option?
Some of you may be asking why do we even need a “0” option to begin with? Well, most of the time, you really don’t need to use the “0” option. But there are instances where you may want to be able to manually specify a file name and path rather than select it from a dialog box. Take for example, a SCRIPT file that automatically loads and add-on or resource file that you need to use in AutoCAD. To fully automate the process, the script would need to be able to locate and open a file from a specified location without any user input. Otherwise, it would pause and wait for the user to navigate to and select the file before completing the process. In that case, FILEDIA would be set to “0” as part of the script so that the author can include the full file path for the resource file in the script. 
 

So there you have it, if you ever encounter a problem where your file dialog box is missing and you’re prompted to enter the file path at the command line, change your FILEDIA system variable to “1” instead of “0” and everything should be back to normal.


Matt Miyamoto, P.E.
Ideate AEC Application Specialist

Matt is a licensed Civil Engineer in the state of Hawaii. Matt obtained a BS in Mechanical Engineering from the University of Hawaii at Manoa, and has 7 years of private sector design experience which he applies in his role as an application specialist with Ideate, Inc. His project experience includes residential and commercial site development, private and public sewer, water and drainage systems, harbors improvements, and roadway improvements. While in Hawaii, Matt was involved in multidisciplinary projects for City and County agencies, State Departments, the Army COE and private developers. @MattM_PE

Get it. Know it. Use it.