LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D Picture Control: Find Object function closes scene reference when it has no children

I am using Labview 8.2

The "Find Object.vi" function is causing me some problems as it is closing the reference to the Scene Object passed into it when that Scene object does not contain any child objects.  The attached screengrab shows the relevant part of the "Find Object.vi" function - the input (parent) reference is added to the front of the queue, and if the "ObjectCount" method returns 0, then the reference is closed (and hence unavailable from that point on.  By removing the "Close Reference" function, the reference remains valid, but I am unsure of what other consequences this would have (and I don't like editing NI VI's!).

I have attached an example VI to illustrate this, hopefully it is clear enough what is happening.  Basically, I want to be able to check for the existence of a child object without risking losing the parent object's reference.  I could always write my own but perhaps the "Find Object.vi" function is incorrect?
Download All
0 Kudos
Message 1 of 3
(2,429 Views)
pauldavey,

I agree with you again that the behavior of "Find Object.vi" does not appear to be optimal.  It is almost as if it should be called "Select Object.vi" as it doesn't appear to be handling the case in which no objects are found very well.

The help file states that it:

Takes a 3D scene reference
and an object name and returns the first object in the scene with a matching
name.

As it's behavior is not defined for the event that a matching object is not found I would recommend writing your own VI to perform the function you need.

I plan on looking a little further into this and I may end up filing a CAR for this behavior too.

We appreciate the feedback and I apologize for the difficulties this VI is causing you.

Regards,

Simon H
Applications Engineer
National Instruments


0 Kudos
Message 2 of 3
(2,410 Views)
After a little more digging I still agree with you and have passed this on to R&D.

For those keeping track:

This was reported to R&D (# 43FCQVQ) for further investigation.

~Simon
0 Kudos
Message 3 of 3
(2,394 Views)