Collection of Elements Within a Prismatic Volume (Not Rectangular)

Hi guys,

I have written a small macro to collect elements like VALV, FILT, EQUI etc. that stays inside the group of volume objects. By volume objects I mean, prismatic shapes that we either created as  primitive extrusion from equipment module, or imported from other 3D program as GENPRI. Using the below syntax for valves as example:

VAR !X COLLECT ALL VALV WITHIN VOLUME /"Name of the Volume Object"

The problem is, if the volume object is not a rectangular prism, lets say it is a triangular prism, the program gathers the valves for as if it is a rectangular one. So it is not using the exact volume of the shape, it uses the volume of rectangular prism which the exact shape just fits in. Because of that, we are having valves that are actually not inside the volume object.

Any help would be appreciated.

Thanks.