Welcome
Expand Getting StartedGetting Started
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand FeatureWorks API HelpFeatureWorks API Help
Expand SOLIDWORKS Costing API HelpSOLIDWORKS Costing API Help
Expand SOLIDWORKS Document Manager API HelpSOLIDWORKS Document Manager API Help
Expand SOLIDWORKS Routing API HelpSOLIDWORKS Routing API Help
Expand SOLIDWORKS Simulation API HelpSOLIDWORKS Simulation API Help
Expand SOLIDWORKS Sustainability API HelpSOLIDWORKS Sustainability API Help
Expand SOLIDWORKS Toolbox API HelpSOLIDWORKS Toolbox API Help
Expand SOLIDWORKS Utilities API HelpSOLIDWORKS Utilities API Help
Expand eDrawings API HelpeDrawings API Help
Expand DraftSight API HelpDraftSight API Help
Expand Lisp Programming BasicsLisp Programming Basics
Expand Lisp Functions OverviewLisp Functions Overview
Collapse Lisp Functions ReferenceLisp Functions Reference
Lisp Functions by Alphabetical Order
*error*
+ (Addition)
- (Subtraction)
* (Multiplication)
/ (Division)
1+ (Increment)
1- (Decrement)
Equal
Not equal
Greater than
Greater than or equal
Less than
Less than or equal
~ (Bitwise NOT)
abs
acad_colordlg
acad_strlsort
action_tile
add_list
alert
alloc
and
angle
angtof
angtos
append
apply
ascii
assoc
atan
atof
atoi
atom
atoms-family
boole
boundp
car
caaaar ... cddddr
cdr
chr
client_data_tile
close
command
cond
cons
cos
defun
dictadd
dictnext
dictremove
dictrename
dictsearch
dimx_tile
dimy_tile
distance
distof
done_dialog
end_image
end_list
entdel
entget
entlast
entmake
entmakex
entmod
entnext
entsel
entupd
eq
equal
eval
exit
exp
expand
expt
fill_image
findfile
fix
float
foreach
gc
gcd
get_attr
get_tile
getangle
getcfg
getcname
getcorner
getdist
getenv
getfiled
getint
getkword
getorient
getpoint
getreal
getstring
getvar
graphscr
grclear
grdraw
grread
grtext
grvecs
handent
help
if
initget
inters
itoa
lambda
last
length
list
listp
load
load_dialog
log
logand
logior
lsh
mapcar
max
mem
member
menucmd
menugroup
min
minusp
mode_tile
namedobjdict
nentsel
nentselp
new_dialog
not
nth
null
numberp
open
or
osnap
pi (Constant)
polar
prin1
princ
print
progn
prompt
quit
quote
read
read-char
read-line
redraw
regapp
rem
repeat
reverse
rtos
set
set_tile
setcfg
setenv
setfunhelp
setq
setvar
setview
sin
slide_image
snvalid
sqrt
ssadd
ssdel
ssget
sslength
ssmemb
ssname
start_dialog
start_image
start_list
startapp
strcase
strcat
strlen
subst
substr
tan
tblnext
tblobjname
tblsearch
term_dialog
terpri
textbox
textpage
textscr
trans
type
unload_dialog
vector_image
ver
vmon
vports
wcmatch
while
write-char
write-line
xdroom
xdsize
zerop
Hide Table of Contents

findfile

(findfile filename [condition])

The findfile function searches for the file specified by filename and returns the complete name including drive and directory path.

  1. If condition = nil:

    Search for a file in a certain order. The function returns a complete file name (including drive and path) of the file found first in the (application) search path. It returns nil, if no file has been found.
  2. If condition = T:

    The function returns a list of file names in the specified or in the current drive/path.

    Note:
    • the list of file names is not sorted
    • a path name is not returned

The order in which the function browses directories to find the specified file is as follows:

  1. Current directory
  2. Drawing directory as specified with the Options command under File Locations > Drawing Support > Drawing Files Location. Use (getenv "CADDWG") to determine the drawing folder.
  3. Support Files search path as specified with the Options command under File Locations > System > Support Files Search Path. Use (getenv "CADSUP") to determine the support files path.

Examples

: (findfile "C:\\Home\\Sample\\*.dwg" T)

("1.dwg" "prototype.dwg" "NONAME_0.dwg")

: (findfile "ANTIVIRUS.EXE")

"D:\\Program Files\\AntiVirus\\ANTIVIRUS.EXE"

Related Functions

getfiled



Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   Function findfile
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2019 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.