Syntax

code

Function: IItem.DeleteItem(ItemPath: String): Boolean;


Description

Deletes the item specified by ItemPath from the system.


Code Reference


code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

var

  ps: IPlanSwift;

  est: IItem;

  i: Integer;

  itm: IItem;

begin

  // Create Planswift Interface

  ps := coPlanswift.Create;

  // Get the Estimating Tab

  est := ps.GetItem('Job\Takeoff');

  // Loop through all items on the first level

  for i := est.ChildCount - 1 downto 0 do

  begin

    // Get the item at index i

    itm := est.ChildItem[i];

    // delete the item

    itm.Delete;

  end;

  // Free Planswift

  ps := nil;

end;