Ansys Tips
Ansys Tips
Ansys Tips
Solutions Inc
Date
Subject
Keywords
Memo Number
July 16, 2000
STI56:000716
ANSYS Tips & Tricks: Opening ANSYS Files by Double-Clicking
Windows NT: File Association
1. Introduction:
Double-clicking ANSYS *.db files in Explorer under Windows is a very useful feature. This memo
describes how to configure ANSYS 5.4 through 5.6 to enable opening database files by simply
double-clicking on the *.db icon. [It is useful to note that while ANSYS 5.6 automatically enables file
association with the *.db file, there are many limitations to this approach.]
2. Background Discussion:
Starting from ANSYS 5.6, the installation setup process under Windows associates *.db and
*.grph files, such that they can be opened in Explorer simply by double-clicking on the *.db or *.grph
icon. The way this works is that an undocumented -FILE argument to the ansysir.exe and
displayw.exe executables is used for the file association.
While this may seem to be an improvement from previous versions of ANSYS running on
Windows, the author finds this technique limiting for the following reasons:
This ability is only available for 5.6. 5.5 has a similar undocumented option, but it does not
automatically resume the database.
The last settings specified in ANSYS Interactive (ansysi.exe) are used. This means that the
working directory and jobname are left unchanged from the previous analysis. Subsequent
SAVE commands will produce undesired results if the user is opening a different database
from the last-specified jobname.
Similar to the point above, since the last settings are used, changing memory settings (total
workspace and database space) and graphics drivers (win32, win32c, 3D) are not permitted
without re-launching ANSYS Interactive and respecifying the appropriate values.
These points make this approach cumbersome and confusing. Hence, the author finds that manually
configuring Windows file association gives the user more flexibility.
3. Discussion on Association of *.DB
*.DB Database Files:
The following steps can be performed under Windows to associate *.db files with ANSYS:
1. Create a DOS batch file (regular text file) named launch_ansys56.bat as follows:
----------launch_ansys56.bat---------@echo off
set PATH=%ANSYS56_DIR%\bin\%ANSYS_SYSDIR%;%PATH%
start /b ansys j %~n1 p ane3flds m %2 db %3 d %4 g SIRESUME yes
-------------end of file-------------Save this batch file in any location, such as C:\location_of_scripts.
2.
3.
Collaborative
Solutions Inc
will be resumed and plotted (for win32/32c, the model will be resumed but not plotted).
In Step 1 above, a DOS batch file was used to parse arguments to ANSYS and launch the ANSYS
executable. The second line adds the ANSYS executables, namely the ansys.exe program, in the
PATH variable. The third line launches the ansys.exe program standalone (start /b ansys). The
jobname is input via the %~n1 argument; usually, Windows passes the full file name to the program.
The use of the %~n1 argument restricts this input to just the file, without file extension (i.e., the
ANSYS jobname). The license product is specified with -p; in this case, ane3flds uses
ANSYS/Multiphysics/LS-DYNA. Some typical product license codes include:
ansys
ANSYS/Mechanical
ane3
ANSYS/Mechanical/Emag
ane3fl
ANSYS/Multiphysics
ane3flds
ANSYS/Multiphysics/LS-DYNA
Please refer to the ANSYS Installation and Configuration Guide for the appropriate product code
for your license. The workspace (-m), database space (-db), and graphics driver (-d) are input as
arguments to the batch file (explained later). ANSYS is run in interactive mode (-g). Lastly, a
parameter called SIRESUME is also passed to ANSYS with a value of yes.
In Step 2 above, the start56.ans ANSYS startup file was modified. Whenever ANSYS is
1
launched, the start56.ans file is read from the C:\ANSYS56\DOCU directory. This can be forced in
both GUI and batch mode with the -s read argument. The startup file contains information on
settings and commands which ANSYS uses each time it is launched. By adding the lines in Step 2, a
check of a parameter called SIRESUME is performed. If SIRESUME is yes, ANSYS resumes
jobname.db; otherwise, nothing happens.
The action Open (which is usually the default action) is associated with double-clicking the
*.db file. In Step 3, this action was redefined to be associated with the DOS batch script created in
Step 1. Furthermore, four arguments were passed to it: the jobname (%1), 128 MB for total
workspace, 32 MB for database space, and 3D graphics driver. If different settings are desired for the
default action, one can change this easily (e.g., change the arguments to 64 32 win32 for 64 MB
total workspace, 32 MB database space, and win32 graphics driver).
4. Advanced Options for DB File Association:
To allow the user more flexibility in selecting graphics drivers, product licenses, and workspace
& database memory settings, multiple actions can be specified:
Above are Tools > Folder Options dialog boxes for Windows 2000, although Windows NT is very
similar in nature.
An icon can be selected for the *.db files. Select Change Icon (window in middle) and browse
to search for the ansys.exe executable (by default, located in C:\ansys56\bin\intel\ansys.exe). Any
other icon can be selected instead of the default generic icon.
1
If a start56.ans file resides in the %HOMEDRIVE%\%HOMEPATH% directory or the working directory, ANSYS will read that file
instead of C:\ansys56\docu.
2303 W. 190th St Redondo Beach, CA 90278
310.896.1230 FAX 310.896.1240 http://www.csi-ansys.com
Collaborative
Solutions Inc
Because the Open action can only be associated with one setting, a user can easily generate
multiple actions as shown in the middle dialog box above. This way, by right-clicking on the file, the
user can select whether to use 128/32 MB for total workspace and database space or 256/100 MB
instead. Different graphics drivers or different license products (Mechanical vs. Multiphysics) can
also be distinguished in this manner.
In the above example, four actions are associated
with the *.db file. If the user right-clicks on the
ANSYS *.db file (as shown on right), these four
commands appear. This gives the user more
flexibility in running ANSYS with as little interaction
as possible.
For the example on the right, three additional
actions were created by selecting New in the Edit
File Type dialog box above. Similar settings were
used as before, although, this time, different graphics
device and memory settings were input as follows:
Open 5.6 128/32 [3D]:
C:\..\launch_ansys56.bat "%1" 128 32 3D
Open 5.6 128/32 [win32]:
C:\..\launch_ansys56.bat "%1" 128 32 win32
Open 5.6 64/32 [3D]:
C:\..\launch_ansys56.bat "%1" 64 32 3D
2.
Go in Windows Explorer, under View > Folder Options (or Tools > Folder Options in
Windows 2000). Select the tab File Types. Scroll down to find the INP file extension
(or create a new file type if it does not exist). Select Edit (or Advanced under Windows
2000). Select a New action, and type the following instead:
Collaborative
Solutions Inc
in a DOS window to delete that file association. Double-click on the *.inp file, and link it with
notepad (or any text editor), but, this time, giving it a description. Now, the *.inp filetype should
appear in Windows NT File Type dialog box.
8. Conclusion:
The use of DOS batch files makes linking ANSYS database files (*.db) and input files (*.inp) much
easier in Windows Explorer. Not only can a user double-click on a *.db file to launch ANSYS and
resume the database, but the user can configure the right-click pop-up menu to allow several other
choices. This provides much flexibility while retaining the ease-of-use in Windows.
Some of this technique can be extended to UNIX, namely any platform running CDE (Common
Desktop Environment) with the dtfile file manager. However, because most UNIX users are
comfortable launching programs by typing in the xterm window, only the Windows method of file
association was covered in this memo.
__________________________
Sheldon Imaoka
Collaborative Solutions, Inc. (LA Office)
Engineering Consultant
Collaborative
Solutions Inc
Corrections, comments, and suggestions are welcome and can be sent to operator@csiansys.com [they will be distributed to the appropriate person(s)]. While CSI engineers base their
TOTW on technical support calls and user questions, ideas on future topics are appreciated. Users
who wish to submit their own TOTW are encouraged to do so by emailing the above address for
more information.
Greg Miller
Sheldon Imaoka
WWW: http://www.csi-ansys.com
FTP: ftp://ftp.csi-ansys.com
Sean Harvey
David Haberman
Alfred Saad
Mike Rife
CSI believes strongly in the value of training and mentoring to help make customers successful
using ANSYS. Training classes are usually 2-3 days in duration and provide instruction on various
topics, including structural nonlinearities, heat transfer, and dynamics. Mentoring sessions involve
working with a CSI engineer one-on-one on specific projects. These sessions help reinforce
applicable subject matter covered in training classes or help ensure that the customer is using ANSYS
most efficiently and effectively.
Training class schedules are posted at: http://www.csi-ansys.com/training.htm
Please contact your account manager for more details on training, mentoring, consulting, and
other CSI services.
2303 W. 190th St Redondo Beach, CA 90278
310.896.1230 FAX 310.896.1240 http://www.csi-ansys.com