Syntax

code

Function: IItem.ChildCount: Integer;


Description

Returns the number of child items for the item.


Code Reference


code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

var

  ps: IPlanSwift;

  est: IItem;

  i: Integer;

  itm: IItem;

  txt: String;

begin

  // Create Planswift Interface

  ps := coPlanswift.Create;

  // Get the Estimating Tab

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

  // Loop Through All Items

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

  begin

    itm := est.ChildItem[i];

    // Add Names of all Items to txt var

    txt := txt + itm.Name + #13#10;

  end;

  // Show Message of all items on 1st level

  ShowMessage('First Level estimating Items:' + #13#13 + txt);

  // Free Planswift Interface

  ps := nil;