Procedure CountSchObjects(); Var Server : ISchServer; Document : ISch_Document; Iterator : ISch_Iterator; Obj : ISch_BasicContainer; MsgStr : string; CntLabel : integer; CntNetLabel : integer; CntWire : integer; CntPort : integer; Begin Server := SchServer; If Server = Nil Then Begin ShowError('No SchServer started'); Exit; End; Document := SchServer.GetCurrentSchDocument; If Document = Nil Then Begin ShowError('Current document is not SCH document'); Exit; End; CntLabel:=0; CntNetLabel:=0; CntWire:=0; CntPort:=0; Iterator := Document.SchIterator_Create; Obj := Iterator.FirstSchObject; While Obj <> Nil Do Begin Case obj.ObjectID of eLabel : inc(CntLabel); eNetLabel : inc(CntNetLabel); eWire : inc(CntWire); ePort : inc(CntPort); end; Obj := Iterator.NextSchObject; End; MsgStr := 'Anzahl Labels : '+inttostr(CntLabel) + #13 ; MsgStr := MsgStr + 'Anzahl NetLabels : '+inttostr(CntNetLabel) +#13; MsgStr := MsgStr + 'Anzahl Wires : '+inttostr(CntWire) +#13; MsgStr := MsgStr + 'Anzahl Ports : '+inttostr(CntPort); ShowInfo(MsgStr); End;