[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to find if an object contains another

How do I determine if an object "contains" another one?

For example, I can create a model object and add a surface object or
a plot object.  Given that model object, how would I find out whether
or not a surface object has been added?

The best I've come up with is something like:

  xx = model->get(/all,isa='idlgrsurface')
  s = size(xx)
  if s[1] eq 11 then $
       print,'Has one or more surface' $
  else $
       print,'Has no surfaces'

Surely there's a simpler way?

A related question is: how do I test if an object pointer (returned by
the GetByName method, for example) is null?

Dave Greenwood                Email: Greenwoodde@ORNL.GOV
Oak Ridge National Lab        %STD-W-DISCLAIMER, I only speak for myself