C++
virtual const ACHAR * searchForActivePath();
Description
This function searches the local drives and network for a valid image file that matches the source file name that is saved in the drawing file. This mechanism allows image files to be located differently on machines that are used for editing or viewing the same drawing file. Users can set up project search paths that contain directories in which image and xref files may be contained.
The search for a valid image file follows a specific order. First, the source file name (the path name set by setSourceFileName() and saved in the drawing) is checked as is. If it doesn't indicate a valid image file, then the file name is extracted from the path.
For example, a path of c:imagespicture1.bmp has the filename picture1.bmp. This file name is then searched for in each of a series of directories specified by the current project, followed by the standard AutoCAD paths.
The search order is as follows:
- The source file name as specified by AcDbRasterImageDef::setSourceFileName().
- The current project directories in order.
- The current directory.
- The directory that contains the current drawing file.
- The directories named by the ACAD environment variable (if this variable has been specified).
- The directory that contains the AutoCAD program files.
The first valid image file that is found will terminate the search. If the file extension is omitted from the file name, then all files with the same base file name (picture1, picture1.txt, picture1.exe, etc.) are also checked for validity as image files.
Returns the new active path if successful, or NULL otherwise.