[FUNCTION CREATEDYNAMICTREES]
FOR X 512 2048
FOR Y 512 2048
IF <SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS>
FOR I 0 <EVAL <SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS>-1>
IF !<ISEMPTY <SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.TYPE>>
IF (<SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.TYPE> == T_TREE)
SERV.NEWITEM <SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.ID>
NEW.P <dLOCAL.X>,<dLOCAL.Y>,<SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.Z>,0
NEW.FIX
ENDIF
IF (<SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.TYPE> == T_FOLIAGE)
SERV.NEWITEM <SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.ID>
NEW.P <dLOCAL.X>,<dLOCAL.Y>,<SERV.MAP(<dLOCAL.X>,<dLOCAL.Y>,0,0).STATICS.<dLOCAL.I>.Z>,0
NEW.FIX
ENDIF
ENDIF
ENDFOR
ENDIF
ENDFOR
ENDFOR
RETURN 1