[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to find if an object contains another
- Subject: How to find if an object contains another
- From: Dave Greenwood <greenwoodde(at)ornl.gov>
- Date: 19 OCT 2000 16:36:49 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Oak Ridge National Lab
- Sender: greenwoodde(at)feda34.fed.ornl.gov (Dave Greenwood)
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:21789
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?
Thanks,
Dave
--------------
Dave Greenwood Email: Greenwoodde@ORNL.GOV
Oak Ridge National Lab %STD-W-DISCLAIMER, I only speak for myself