Close

Relief for ODA Team in Ukraine

Learn more
ODA Drawings SDK
OdDgHostAppServices::findFile Method
Syntax
C++
virtual OdString findFile(const OdString& filename, OdDbBaseDatabase* pDb = 0, FindFileHint hint = kDefault);

Returns the fully qualified path to the specified file. 

 

Parameters
Description
filename
[in] Name of the file to find.
pDb
[in] Pointer to the database context.
hint
[in] Hint that indicates the type of file that is required.

Returns an empty string if the file is not found. 

This function is called by ODA Drawings API for DGN when access is needed to a file, such as a font file, a template file, etc. 

pDb == 0 specifies that this file search is not related to a database. 

If pDb != 0, call pDb->getFilename() to determine the path to the DGN file associated with the database. 

The typical search order is as follows: 

 

  1. The filename itself.
  2. The current directory.
  3. The drawing directory (for shx font, image, and xref files).
  4. The Windows fonts directory (only for TTF fonts on Windows).

 

hint must be one of the following: 

 

Name
Value
Description Extension
kDefault
0
Any file Any
kFontFile
1
Can be either SHX or TTF file SHX or TTF
kCompiledShapeFile
2
SHX file SHX
kTrueTypeFontFile
3
TTF file TTF
kEmbeddedImageFile
4
Image file ISM
kXRefDrawing
5
External reference file
kPatternFile
6
Pattern file PAT
kTXApplication
7
ODA Platform Xtension Application file TX
kFontMapFile
8
FontMap file FMP
Copyright © 2002-2022. Open Design Alliance All rights reserved.