Skip to content

[mxcad_2d API documentation] (../README. md)/[2d] (../modules/2d. md)/MxCADUI

Interface: MxCADUI

2d.MxCADUI

MxCADUI defines the host interaction interface between the plugin and the MxCAD main application.

Description

This interface provides plugin initialization, file upload, host configuration query, and current MxCAD object access capabilities. Through it, plugins can obtain download configurations, upload files, determine the running environment, and access current CAD and map objects. Summary of usage:

  1. During plugin initialization, the host passes in the 'MxCADUI' instance;
  2. Call init (plugin) to complete plugin registration;
  3. Use methods such as' uploadFile ',' getUploadFileConfig ',' isMxCADAppLib 'to interact with the host.

Table of contents

Properties

Properties

getServerConfig

getServerConfig: () => any

Type declaration

▸ (): any

Get the mxServerConfig. json file configuration

Returns

any


getUploadFileConfig

getUploadFileConfig: () => { baseUrl: string ; cutDwgUrl: string ; mxfilepath: string ; printPdfUrl: string ; saveDwgUrl: string ; saveUrl: string }

Type declaration

▸ (): Object

Get file download configuration

Returns

Object

NameType
baseUrlstring
cutDwgUrlstring
mxfilepathstring
printPdfUrlstring
saveDwgUrlstring
saveUrlstring

init

init: (plugin: MxCADPluginBase) => void

Type declaration

▸ (plugin): void

initialization

Parameters
NameTypeDescription
Plugin[MxCADPluginBase] (../classes/2d. MxCADPluginBase. md)Basic Configuration
Returns

void


isMxCADAppLib

isMxCADAppLib: () => boolean

Type declaration

▸ (): boolean

Is the current program running in MxCADAppNpm packaging mode.

Returns

boolean


mxcad

mxcad: McObject

MXCAD object


mxmap

mxmap: MxMap

Mxmap object


uploadFile

uploadFile: (uploadFile_call: (param: any) => void, isReloadFile: boolean) => void

Type declaration

▸ (uploadFile_call, isReloadFile): void

Upload a file, format it, and use it for subsequent processing.

Parameters
NameType
uploadFile_call(param: any) => void
isReloadFileboolean
Returns

void