SIObject.IsClassOf.2.js Example
Applies To
SIObject.IsClassOf method
Description
This example demonstrates how to use the SIObject.IsClassOf method.
Code
/*
The SIObject.IsClassOf() method can be very useful in determining whether
the selection contains a 3DObject.
*/
newscene(null, false);
CreateModel(null, null, null, null);
Application.LogMessage( "Is the selected "+selection(0).name+" object a 3dobject? " + selection(0).IsClassOf(siX3DObjectID) );
CreatePrim("Sphere", "MeshSurface", null, null);
var obj = selection(0);
Application.LogMessage( "Is the selected "+selection(0).name+" object a 3dobject? " + selection(0).IsClassOf(siX3DObjectID) );
SelectGeometryComponents("sphere.pnt[1,6-8,14,15,22,29,35,36,40-43,47-50,54-LAST]");
CreateCluster(null);
Application.LogMessage( "Is the selected "+selection(0).name+" object a 3dobject? " + selection(0).IsClassOf(siX3DObjectID) );
// Expected result:
//INFO : Is the selected Model object a 3dobject? true
//INFO : Is the selected sphere object a 3dobject? true
//INFO : Is the selected Point object a 3dobject? falseRelated Examples
Keywords
SIObject IsClassOf
Autodesk Softimage 2011