Difference between revisions of "CAEngine::OpenModel/zh"
(Created page with "= 返回值 =") |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
从磁盘文件读取一个模型,打开并作为当前模型。«fileSpec»按[[CurrentModelDirectory | 当前模型目录]]进行解释。 | 从磁盘文件读取一个模型,打开并作为当前模型。«fileSpec»按[[CurrentModelDirectory | 当前模型目录]]进行解释。 | ||
− | = | + | = 参 数 = |
− | ; | + | ;FileSpec:string——字符串(包含模型的文件名) |
= 返回值 = | = 返回值 = | ||
− | + | ModelName——字符串(实际模型名称) | |
− | = | + | = 示例用法 = |
string modName = ade.OpenModel("C:\TMP\MYMODEL.ANA"); | string modName = ade.OpenModel("C:\TMP\MYMODEL.ANA"); | ||
− | = | + | = 说明 = |
− | + | 通过检查返回值是否为"",而不是通过检查值为0[[ErrorCode/zh | 错误代码]]来探测失败。有可能在载入过程中出现某些错误或者警告,因此由[[CAEngine::ErrorCode/zh | 错误代码]]、[[ErrorCode::ErrorText/zh | 错误文本]],以及[[CAEngine::OutputBuffer/zh | OutputBuffer]]属性来反映,即使载入成功也如此。 | |
− | [[ErrorCode]] | ||
− | |||
− | = API | + | = API 错误 = |
− | * 2 – | + | * 2 – 警告(但是完全成功载入) |
− | * 3 – | + | * 3 – 词汇错误(部分成功载入) |
− | * 4 – | + | * 4 – 语句错误(部分成功载入) |
− | * 39 – | + | * 39 – “模型未找到” |
Latest revision as of 08:10, 20 October 2015
ADE User Guide > ADE Server Class Reference > CAEngine
OpenModel(fileSpec)
从磁盘文件读取一个模型,打开并作为当前模型。«fileSpec»按 当前模型目录进行解释。
参 数
- FileSpec:string——字符串(包含模型的文件名)
返回值
ModelName——字符串(实际模型名称)
示例用法
string modName = ade.OpenModel("C:\TMP\MYMODEL.ANA");
说明
通过检查返回值是否为"",而不是通过检查值为0 错误代码来探测失败。有可能在载入过程中出现某些错误或者警告,因此由 错误代码、 错误文本,以及 OutputBuffer属性来反映,即使载入成功也如此。
API 错误
- 2 – 警告(但是完全成功载入)
- 3 – 词汇错误(部分成功载入)
- 4 – 语句错误(部分成功载入)
- 39 – “模型未找到”
Comments
Enable comment auto-refresher