CAD制作简单动画 | 您所在的位置:网站首页 › cad可以做三维动画 › CAD制作简单动画 |
function InitDraw() { draw = document.getElementById("MxDrawXCtrl"); draw.ImplementCommandEventFun = function DoCommandEventFunc(iCmd) { if (iCmd == 1) { // 启动时打开文件 draw.OpenDwgFile(draw.GetOcxAppPath() + "\\Blk\\animation.dwg"); var animation = draw.NewComObject("IMxDrawAnimation"); //把对象初始化成动画状态 animation.InitAnimationEntity2("211"); animation.InitAnimationEntity2("212"); animation.InitAnimationEntity2("213"); // 启动一个控件时钟事件,用于实现动画。 draw.CallLongParam1("Mx_StartUserTimer", 30); } }; draw.ImplementCustomEvent = function CustomEvent(sEventName) { if (sEventName == "Mx_UserTimer") { var animation = draw.NewComObject("IMxDrawAnimation"); //开始一个动画绘制过程 animation.StartDraw(); // 211 212 213是需要旋转实体的句柄. RotateEnt("211", animation); RotateEnt("212", animation); RotateEnt("213", animation); //结束动画绘制过程 animation.EndDraw(); // 注意需要显示释放递代器.,不然会引起错误 animation = null; CollectGarbage(); } }; } |
CopyRight 2018-2019 实验室设备网 版权所有 |