Not an answer to your code but the way I did it was for CIV3D with a dynamic block, it had 2 objects a circle for trunk and a pattern for spread, so simply changed the size of the relevant trunk or spread no complicated visibilty. It added a block based on a field code, see below.
; RawDescription = "TR 5 1.5" replace tr as required add extra tree types also
(LM:setdynpropvalue obj2 "Trunk" trunk)
(LM:setdynpropvalue obj2 "Spread" spread)