Advertisement
DieFeM

RemovePrecombineData.pas

Apr 9th, 2020
824
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.46 KB | None | 0 0
  1. {
  2.   New script template, only shows processed records
  3.   Assigning any nonzero value to Result will terminate script
  4. }
  5. unit userscript;
  6.  
  7. // Called before processing
  8. // You can remove it if script doesn't require initialization code
  9. function Initialize: integer;
  10. begin
  11.   Result := 0;
  12. end;
  13.  
  14. // called for every record selected in xEdit
  15. function Process(e: IInterface): integer;
  16. var
  17.   el: IInterface;
  18. begin
  19.   Result := 0;
  20.  
  21.   // processing code goes here
  22.   if Signature(e) = 'CELL' then begin
  23.     AddMessage('Processing CELL: ' + FullPath(e));
  24.     if ElementExists(e, 'PCMB') then begin
  25.       el := ElementByPath(e, 'PCMB');
  26.       if Assigned(el) then
  27.         RemoveElement(e, el);
  28.     end;
  29.     if ElementExists(e, 'XPRI') then begin
  30.       el := ElementByPath(e, 'XPRI');
  31.       if Assigned(el) then
  32.         RemoveElement(e, el);
  33.     end;
  34.     if ElementExists(e, 'XCRI') then begin
  35.       el := ElementByPath(e, 'XCRI');
  36.       if Assigned(el) then
  37.         RemoveElement(e, el);
  38.     end;
  39.     if ElementExists(e, 'VISI') then begin
  40.       el := ElementByPath(e, 'VISI');
  41.       if Assigned(el) then
  42.         RemoveElement(e, el);
  43.     end;
  44.     if ElementExists(e, 'RVIS') then begin
  45.       el := ElementByPath(e, 'RVIS');
  46.       if Assigned(el) then
  47.         RemoveElement(e, el);
  48.     end;
  49.   end;
  50. end;
  51.  
  52. // Called after processing
  53. // You can remove it if script doesn't require finalization code
  54. function Finalize: integer;
  55. begin
  56.   Result := 0;
  57. end;
  58.  
  59. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement