Adding a copy of the file format for the machining center and changing tool parameters
Go to navigation
Go to search
The script uses two events. First - at the moment of program start the script adds a copy of one of the existing file formats to the list of files for data export by the OnAppStart event. The second event - at the moment of file generation the script checks that the event is caused by the newly added file format and changes tool codes, deleting unnecessary tools.
procedure OnAppStart; begin gd.StanokExports.AddItem(1000,'Обрабатывающий центр Schirmer BAZ-1000-2, формат "$TX" (*.$TX)|*.$TX',bpemObrabBAZ1000,2); end; procedure OnStanokExportBeforeCreateStructure; var i,k:integer; bi:TBinaryPilaExpItem; ooi1:TObrabOperItem; begin if gd.StanokExportCore.IdStanokExport<>1000 then exit; //Showmessage('Event!!! '+inttostr(gd.StanokExportCore.IdStanokExport)); for i:=0 to gd.StanokExportCore.Items.Count-1 do begin bi:=gd.StanokExportCore.Items.GetByNum(i); if assigned(bi)then begin // меняем номера инструментов for k:=0 to bi.ObrabItems.Count-1 do begin ooi1:=bi.ObrabItems.GetByNum(k); if ooi1.Instr='285' then ooi1.Instr:='270'; if ooi1.Instr='295' then ooi1.Instr:='270'; if ooi1.Instr='002' then ooi1.Instr:='001'; if ooi1.Instr='021' then ooi1.Instr:='020'; if ooi1.Instr='022' then ooi1.Instr:='020'; if ooi1.Instr='031' then ooi1.Instr:='030'; if ooi1.Instr='032' then ooi1.Instr:='030'; if ooi1.Instr='051' then ooi1.Instr:='050'; end; // удаляем инструменты k:=0; while k<bi.ObrabItems.Count do begin ooi1:=bi.ObrabItems.GetByNum(k); if ooi1.Instr='250' then ooi1.Instr:=''; if ooi1.Instr='251' then ooi1.Instr:=''; if ooi1.Instr='286' then ooi1.Instr:=''; if ooi1.Instr='287' then ooi1.Instr:=''; if ooi1.Instr='296' then ooi1.Instr:=''; if ooi1.Instr='297' then ooi1.Instr:=''; if ooi1.Instr='' then bi.ObrabItems.Delete(k) else inc(k); end; end; end; end;