SilverScreen Solid Modeler

FindChild method

FindChild method

Previous topic Next topic  

FindChild method

Previous topic Next topic JavaScript is required for the print function  

 

SilverSharpAPI

 

BOS_NODE FindChild(string name);              

 

string name;   // A System.String object

 

 

 




Synopsis

using SilverSharp;

 

The FindChild method searches the block entity for a child with the name specified. The search is case-insensitive and searches only immediate children (not all descendents).

 

 

Parameters

name is a string containing the name of the child entity you wish to find.

 

 

Return Value

FindChild returns a SilverSharp.BOS_NODE object if successful, or null otherwise.

 

 

Remarks

The inherited IsEmpty method can be used to test the result.

 

 

See Also

BLOCK_NODE, Entity types, IsEmpty

 

 

Example

The following code searches a BLOCK_NODE (assumed to be valid) for a child called 'door':

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 BLOCK_NODE blk = new BLOCK_NODE("block ROOT");

 BOS_NODE   bos;

 

 if ( BOS_NODE.IsEmpty(blk) )

    return;

 

 bos = blk.FindChild("door");

 

 if ( BOS_NODE.IsEmpty(bos) )

    return;

 

 SC.error_message("A child named door was located: {0}", bos);