Generating random sphere

hi , i currently working on a project and i have to generate sphere in different position like in the figure. im doing this by using visual studio and solidworks. the problem  is im unable to generate the sphere away from the plane

Message was edited by: Peter Johnson

SolidworksApi/macros