//////////////////////////////////////////////////////////////////////////// // System Pre-define Functions // 95099372-ef3e-11ea-9c81-bf848405c62e //Callback of data preparation stage before UI is fully loaded. function OnInitializeData(reload, preview) { PUI(()=>{ //you can access the 'ui' namespace in the parent form using the variable 'pui' here. //The 'pui' variable is valid in all functions of this document. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable. }); } //Callback after UI is fully loaded and displayed. function OnReady(reload, preview) { PUI(()=>{ //you can access the 'ui' namespace in the parent form using the variable 'pui' here. //The 'pui' variable is valid in all functions of this document. //For robustness, you'd better use 'PUI(cb);' to access 'pui' variable. }); } function OnCloseForm() { } function OnException(err) { //ui.MessageBox('Error', '' + err, MessageBox.Icon.Critical, MessageBox.Button.Ok); } ////////////////////////////////////////////////////////////////////////// // Callback Functions. // 641a254c-ef3e-11ea-bc8a-379bb908bdd7 function OnReturn(){ unit.form.mainfrm.menu(4); } function OnBrep(){ unit.form.mainfrm.OnSend('genBrep ' + ui.listBox.value); if(model.getModelCode()){ unit.form.mainfrm.OnSend('genBrep ' + ui.listBox.value); unit.form.mainfrm.OnChangePicture(3, 2); //unit.form.mainfrm.OnCueline('

恭喜您,完成Brep文件的保存!

'); unit.form.mainfrm.OnCueline('完成Brep文件的保存!', 'green'); }else{ unit.form.mainfrm.OnChangePicture(3, 3); //unit.form.mainfrm.OnCueline('

非常抱歉,您并未在配点加载中设置参数或您设置的参数并未保存

'); unit.form.mainfrm.OnCueline('您并未在配点加载中设置参数或您设置的参数并未保存', 'red'); } } function OnPickUp(){ unit.form.mainfrm.OnSend('rendererFace ' + ui.listBox.value); unit.form.mainfrm.OnChangePicture(3, 1); //unit.form.mainfrm.OnCueline('

选取的面已在界面中选中,请不要忘记生成它的Brep文件!

'); unit.form.mainfrm.OnCueline('选取的面已在界面中选中,请不要忘记生成它的Brep文件!', 'blue'); } function OnShow(){ unit.form.mainfrm.OnSend('selectId'); unit.form.mainfrm.OnChangePicture(3, 1); //unit.form.mainfrm.OnCueline('

拾取的各个面ID已在记录中,注意事项:选中功能不能有空值,否则界面会崩溃!

'); unit.form.mainfrm.OnCueline('拾取的各个面ID已在记录中,注意事项:选中功能不能有空值,否则界面会崩溃!', 'blue'); } //The message corresponding callback executed by the docker pane. // when calling [side_pane].fireEvent(type,para) in the main form. function OnParentDockerMessage(type, para) { } ////////////////////////////////////////////////////////////////////////// // Utils Functions. // 6c165ad6-ef3e-11ea-987c-b761a131c2fe function onDragFile(filepath) { } function PUI(cb) { if(pui){cb();} } CW_DeclareVariable("list", val => { ui.listBox.list = [ val ]; }, () => {}); /*Usage of BLOCK_EVENT BLOCK_EVENT(()=>{ ui.[name].[var] = ...; }); */ function BLOCK_EVENT(cb) { ui.block_event = true; cb(); ui.block_event = false; } ////////////////////////////////////////////////////////////////////////// // template codes for cw callback js. function CW_DeclareVariable(name, setter, getter) { if(typeof(__DeclareVariable) === 'function') { __DeclareVariable(name, setter, getter); } } function CW_DeclareOuterVariable(name) { if(typeof(__DeclareOuterVariable) === 'function') { __DeclareOuterVariable(name); } }