Deleting all children of a class:
Be careful with this one!
You might want to save your model before trying it:
if you want to delete all children of a class object with a method you have to count backwards (as the deleted objects will immideately be missing in the counting). This lines will do the job:
for i := n downto 1 loop --count backwards
.MaterialFlow.Line.childNo(i).deleteobject; --delete object