JavaScript SDK版本3.6.72
2020-04-01
/* 根据平面的位置、方向、偏移值设置剖切面位置
* origin, Type: Object, 描述:插入平面的位置
* direction, Type: Object, 描述:插入平面的方向
* offset, Type: Object, 描述:插入平面的偏移值
*/
viewer3D.setPositionByPlane(origin, direction, offset);
/* 修改构件线框颜色
* ids, 类型:Array, 描述:构件ID
* conditions, 类型:Array, 多个condition的数组, 描述:筛选条件, 从getObjectDataById(objectId)获取
* color, 类型:Glodon.Web.Graphics.Color
*/
var color = new Glodon.Web.Graphics.Color(17, 218, 185, 30);
viewer3D.overrideComponentsFrameColorById(ids, color);
viewer3D.overrideComponentsFrameColorByObjectData({["levelName":"F2"], ["family":"基本墙"]}, color);
// 清除构件线框颜色
viewer3D.restoreComponentsFrameColorById(ids);
viewer3D.restoreComponentsFrameColorByObjectData({["levelName":"F2"], ["family":"基本墙"]})
// 禁止模型平移、缩放
viewer3D.enableTranslate(true);
viewer3D.enableScale(true);
/* 设置模型旋转中心
* 优先级:设置的旋转中心 >选中构件的包围盒中心 >模型场景中心
* point, 类型:Glodon.Web.Geometry.Point3d, 描述:旋转中心, 缺省值为场景中心
*/
var point = new Glodon.Web.Geometry.Point3d(100, 100, 100);
viewer3D.setRotationCenter(point);
// 清除设定的旋转中心
viewer3D.clearRotationCenter();
/* 对水面进行竖向偏移
* offset, Type: Number, 描述:竖向偏移量,单位mm
* 正数向上移动,负数向下移动,缺省值为0
*/
viewer3D.setOffset(offset);
// 获取水面竖向偏移值
viewer3D.getOffset();
BIMFACE智能客服
7*24提供专业的BIMFACE使用支持与帮助