I would like to use Find rather than creating a collection and then
testing it. How come Find is not working ?
Biju
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf
Of brad
Sent: Friday, July 22, 2005 3:00 PM
To: XSI(at)Softimage.COM
Subject: Re: [script] finding Custom Pset
You can populate an XSICollection using the Items property with any
object available in XSI. Any string that works in the text Selection
field will work for your collection. If the items exist, the collection
count will be greater than 0. Here's a quick code snippet:
// Populate an empty collection using string wildcard
var findColl = new ActiveXObject('XSI.Collection');
findColl.Items = '*.LensControls';
var lensProp = findColl(0);
//
Of course, the Collection may find more than one object that matches, or
none at all. It's up to you to test it.
-Brad
-------Original Message-------
Hi there:
After creating a CustomPset, I would like to see if it was created.
Using Find, I am not getting thecorrect answer. Could someone let me
know what I am doing wrong
//script
var oCustomProperty
=Application.ActiveProject.ActiveScene.Root.AddProperty("CustomProperty"
,0,"LensControls") ;
oEnum =
newEnumerator(Application.ActiveProject.ActiveScene.Root.Properties );
for(;!oEnum.atEnd();oEnum.moveNext()) {
logmessage(oEnum.item().fullname);
}
var oPSet
=Application.ActiveProject.ActiveScene.Root.Properties.Find("LensControl
s");
if (oPSet == null){
logmessage("No");
}else{
logmessage ("yes");
}
Thanks
Biju
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi