跨~界开发者中心 跨~界开发者中心
首页
  • iframe二次开发
  • sdk二次开发
转换服务
  • 模型展示
  • 模型操作
  • 构件操作
  • 场景视图
  • GIS操作
  • 矢量文件
  • 数据支持
  • 辅助方法
  • 二维绘图
  • 三维绘图
  • iframe开发示例
  • SDK开发示例
  • 在线查看示例 (opens new window)
首页
  • iframe二次开发
  • sdk二次开发
转换服务
  • 模型展示
  • 模型操作
  • 构件操作
  • 场景视图
  • GIS操作
  • 矢量文件
  • 数据支持
  • 辅助方法
  • 二维绘图
  • 三维绘图
  • iframe开发示例
  • SDK开发示例
  • 在线查看示例 (opens new window)
  • 接口列表

    • 模型展示
    • 模型操作
      • 构件操作
      • 场景视图
      • GIS操作
      • 矢量文件
      • 数据支持
      • 辅助方法
      • 二维绘图
      • 三维绘图
    目录

    模型操作

    # 1.设置模型透明

    设置模型的整体透明度。

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.setWholeTransparency",
            data: { opacity: 0.5 },
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.setWholeTransparency({ opacity: 0.5 });
    

    参数说明:

    opacity:0 - 1之间数字 0 全不透明, 1 全透明


    # 2.恢复模型透明

    恢复模型原来的透明度。

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.clearTransparencyAll",
            data: null,
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.clearTransparencyAll();
    

    # 3.设置模型颜色

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.setModelColor",
            data: { r: 0, g: 0, b: 255 },
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.setModelColor({ r: 0, g: 0, b: 255 });
    

    参数说明:

    r,g,b: 取值范围 0~255


    # 4.恢复模型颜色

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.resetModelColor",
            data: null,
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.resetModelColor();
    

    # 5.X轴面剖切

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.ClipXAxis",
            data: {
                pointx: 2.13,
                pointy: 3.19,
                pointz: 4.34,
                clearExistingPlanes: true,
            },
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.ClipXAxis({
        pointx: 2.13,
        pointy: 3.19,
        pointz: 4.34,
        clearExistingPlanes: true,
    });
    

    参数说明:

    pointx: 模型坐标x

    pointy: 模型坐标y

    pointz: 模型坐标z

    clearExistingPlanes: boolean 是否清除现有基准面


    # 6.Y轴面剖切

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.ClipYAxis",
            data: {
                pointx: 2.13,
                pointy: 3.19,
                pointz: 4.34,
                clearExistingPlanes: true,
            },
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.ClipYAxis({
        pointx: 2.13,
        pointy: 3.19,
        pointz: 4.34,
        clearExistingPlanes: true,
    });
    

    参数说明:

    pointx: 模型坐标x

    pointy: 模型坐标y

    pointz: 模型坐标z

    clearExistingPlanes: boolean 是否清除现有基准面


    # 7.Z轴面剖切

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.ClipZAxis",
            data: {
                pointx: 2.13,
                pointy: 3.19,
                pointz: 4.34,
                clearExistingPlanes: true,
            },
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.ClipZAxis({
        pointx: 2.13,
        pointy: 3.19,
        pointz: 4.34,
        clearExistingPlanes: true,
    });
    

    参数说明:

    pointx: 模型坐标x

    pointy: 模型坐标y

    pointz: 模型坐标z

    clearExistingPlanes: boolean 是否清除现有基准面


    # 8.删除剖切

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.clearClip",
            data: null,
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.clearClip();
    

    # 9.开启包围盒

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.ProjectLocationShow",
            data: null,
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.ProjectLocationShow();
    

    # 10.关闭包围盒

    iframe:

    postKsjMessage(
        {
            commandName: "KSJModelControlApi.ProjectLocationHide",
            data: null,
        },
        (result) => {
            console.log(result);
        }
    );
    

    sdk:

    import { KSJModelControlApi } from "bjksj-sdk";
    KSJModelControlApi.ProjectLocationHide();
    
    模型展示
    构件操作

    ← 模型展示 构件操作→

    Theme by Vdoing | Copyright © 1999-2025 | 北京跨世纪软件技术有限公司 | 京ICP备2020036512号-1
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式