mxcad_2d API 文档 / 2d / MxCADUI
Interface: MxCADUI
2d.MxCADUI
MxCADUI 定义了插件与 MxCAD 主应用间的宿主交互接口。
Description
该接口提供插件初始化、文件上传、宿主配置查询和当前 MxCAD 对象访问能力。 通过它,插件可以获取下载配置、上传文件、判断运行环境,并访问当前 CAD 与地图对象。 使用方法总结:
- 在插件初始化时由宿主传入
MxCADUI实例; - 调用
init(plugin)完成插件注册; - 使用
uploadFile、getUploadFileConfig、isMxCADAppLib等方法与宿主交互。
Table of contents
Properties
Properties
getServerConfig
• getServerConfig: () => any
Type declaration
▸ (): any
获取mxServerConfig.json文件配置
Returns
any
getUploadFileConfig
• getUploadFileConfig: () => { baseUrl: string ; cutDwgUrl: string ; mxfilepath: string ; printPdfUrl: string ; saveDwgUrl: string ; saveUrl: string }
Type declaration
▸ (): Object
获取文件下载配置
Returns
Object
| Name | Type |
|---|---|
baseUrl | string |
cutDwgUrl | string |
mxfilepath | string |
printPdfUrl | string |
saveDwgUrl | string |
saveUrl | string |
init
• init: (plugin: MxCADPluginBase) => void
Type declaration
▸ (plugin): void
初始化
Parameters
| Name | Type | Description |
|---|---|---|
plugin | MxCADPluginBase | 基础配置 |
Returns
void
isMxCADAppLib
• isMxCADAppLib: () => boolean
Type declaration
▸ (): boolean
当前程序是否在MxCADAppNpm打包模式下运行。
Returns
boolean
mxcad
• mxcad: McObject
mxcad对象
mxmap
• mxmap: MxMap
mxmap对象
uploadFile
• uploadFile: (uploadFile_call: (param: any) => void, isReloadFile: boolean) => void
Type declaration
▸ (uploadFile_call, isReloadFile): void
上传一个文件,并格式转换,然用于后续处理。
Parameters
| Name | Type |
|---|---|
uploadFile_call | (param: any) => void |
isReloadFile | boolean |
Returns
void
