WebCAD-Lib-TS API 文档 - v1.0.0
    Preparing search index...

    Interface MainViewConfig

    主视图配置接口

    interface MainViewConfig {
        appname?: string;
        version?: string;
        wasmServiceUrl?: string;
        serviceUrl?: string;
        workspace?: string;
        accessToken?: string;
        accessKey?: string;
        fonts?: {
            path: string;
            name?: string;
            kind?: "ttf" | "woff" | "otf" | "shx";
        }[];
        closeDocOnOpen?: boolean;
        plugins?: PluginConfig[];
        pluginMarketUrl?: string;
        docUrl?: string;
        sidebarStyle?: "left"
        | "right"
        | "none"
        | "both";
        viewMode?: "full" | "viewer";
        showMenuBar?: boolean;
        showToolBar?: boolean;
        showDocBar?: boolean;
        showCoordsBar?: boolean;
        showCommandLine?: boolean;
        showBottomBar?: boolean;
        enableContextMenu?: boolean;
        showGrips?: boolean;
        showUcsIcon?: boolean;
        showAxis?: boolean;
        backgroundAlpha?: number;
        showCrosshair?: boolean;
        disablePointerEvents?: boolean;
        themeMode?: number;
    }
    Index

    Properties

    appname?: string
    version?: string
    wasmServiceUrl?: string
    serviceUrl?: string
    workspace?: string
    accessToken?: string
    accessKey?: string
    fonts?: { path: string; name?: string; kind?: "ttf" | "woff" | "otf" | "shx" }[]
    closeDocOnOpen?: boolean

    打开图纸时关闭当前文档(单文档打开模式)

    • true(默认): 打开新图纸时先关闭当前文档,节省内存
      • 新建文档不受影响,可以正常增加文档数量
    • false: 打开新图纸时保留当前文档(传统方式)
    plugins?: PluginConfig[]

    插件配置列表 - 启动时自动加载的插件

    plugins: [
    { url: '/plugins/find-replace/plugin.js' },
    { url: 'https://example.com/my-plugin.js', cssUrl: 'https://example.com/my-plugin.css' }
    ]
    pluginMarketUrl?: string

    服务端插件市场地址

    访问此地址可获取服务端插件市场的插件列表(JSON格式)。 自动加载的插件会在程序启动时自动下载并加载。

    pluginMarketUrl: "http://127.0.0.1:8082/plugins.json"
    
    docUrl?: string

    官方文档地址

    点击顶栏右侧的文档按钮时打开此地址。 默认为 https://www.vjmap.com

    docUrl: "https://www.vjmap.com/docs"
    
    sidebarStyle?: "left" | "right" | "none" | "both"

    侧边栏样式

    控制侧边栏的初始显示位置:

    • "both": 左右两侧都显示
    • "left": 只显示左侧
    • "right": 只显示右侧(默认)
    • "none": 不显示侧边栏
    sidebarStyle: "none" // 初始不显示侧边栏
    
    viewMode?: "full" | "viewer"

    视图模式

    控制 UI 组件的显示:

    • "full": 完整模式,显示所有 UI 组件(默认)
    • "viewer": 查看模式,只显示绘图区域,隐藏菜单、工具栏、命令行等

    viewer 模式适用于只需要查看和选择实体的场景,可通过 SDK 获取选中实体信息。

    viewMode: "viewer" // 只显示绘图区域
    
    showMenuBar?: boolean

    是否显示菜单栏(细粒度控制) 默认 true。设为 false 时隐藏菜单栏。

    showToolBar?: boolean

    是否显示工具栏/Ribbon(细粒度控制) 默认 true。设为 false 时隐藏工具栏。

    showDocBar?: boolean

    是否显示文档栏(细粒度控制) 默认 true。设为 false 时隐藏文档标签栏。

    showCoordsBar?: boolean

    是否显示坐标栏(细粒度控制) 默认 true。设为 false 时隐藏坐标栏。

    showCommandLine?: boolean

    是否显示命令行(细粒度控制) 默认 true。设为 false 时隐藏命令行。

    showBottomBar?: boolean

    是否显示底部状态栏(细粒度控制) 默认 true。设为 false 时隐藏底部状态栏。

    enableContextMenu?: boolean

    是否启用右键菜单(细粒度控制) 默认 true。设为 false 时禁用右键菜单。 viewer 模式下默认禁用。

    showGrips?: boolean

    是否显示选择夹点(细粒度控制) 默认 true。设为 false 时选择实体后不显示夹点。 viewer 模式下默认禁用(防止通过夹点拖动修改实体)。

    showUcsIcon?: boolean

    是否显示左下角的坐标轴图标(UCS 图标) 默认 true。设为 false 时隐藏左下角的坐标轴指示器。

    showAxis?: boolean

    是否显示图中绘制的坐标轴 默认 true。设为 false 时隐藏图中绘制的坐标轴。

    backgroundAlpha?: number

    背景透明度 (0-1) 默认 1(不透明)。设为 0 可实现透明背景,用于图层叠加场景。

    showCrosshair?: boolean

    是否显示十字光标 默认 true。设为 false 时隐藏十字光标和拾取框。

    disablePointerEvents?: boolean

    是否禁用鼠标事件(允许事件穿透) 默认 false。设为 true 时 canvas 不接收鼠标事件,用于图层叠加场景。

    themeMode?: number

    主题模式 0=深色(默认),1=浅色。影响实体默认颜色等。