  | | | Jscript question.... | Jscript question.... 2004-03-22 - By Rafe Sacks
Back I assume you just used Selection as an example, but to be clear, Selection is a collection already and can be used directly. .AddItems() can add an entire collection to another collection. .Add() will add a single object. Correct me if I am wrong here - Collections can only contain objects, so if you want to pass an object you know the name of but isn't stored to anything, you have to do one of the following:
var oCol = new ActiveXObject( "XSI.Collection" ); var oObj = Dictionary.GetObjcet( "my_3d_objects_name" ); oCol.Add( oObj );
- or get and add the item the object directly -
var oCol = new ActiveXObject( "XSI.Collection" ); oCol.Add( Dictionary.GetObjcet( "my_3d_objects_name" ) );
Arrays can contain strings /or/ objects though. The only time I use collections is when taking the selection list as an input, or when an XSI functions demands it.
- Rafe
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- Bernard Lebel wrote:
> Hi Rafaele, > > Try this: > > var oSel = Selection; > > oColl.additems( oSel ); > > > The additem also works well, but for single element. > > > Cheers > Bernard > > http://www.bernardlebel.com > http://www.xsimontreal.com > http://www.xsibase.com > > > > >> From: Raffaele Scaduto-Medola <raffaele@(protected)> >> Reply-To: XSI@(protected) >> To: XSI@(protected) >> Subject: Jscript question.... >> Date: Fri, 19 Mar 2004 01:19:00 -0500 (EST) >> >> Does anyone have some sample code to put selected elements in a scene >> in a >> XSI.collection objects. >> >> I'm looking for some information in the sdk docs, but having a hard time >> finding it. >> I basically am trying find out (in my script) the names of selected >> object >> in my scene. >> >> Any pointers would be greatly appreciated. >> >> THX >> RSM >> >> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ _____ >> Raffaele Scaduto-Mendola - www.turbolinea.com >> raffaele@(protected) >> --- >> Unsubscribe? Mail Majordomo@(protected) with the following text in >> body: >> unsubscribe xsi > > > __ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ > MSN Premium helps eliminate e-mail viruses. Get 2 months FREE* > http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http ://hotmail.com/enca&HL=Market_MSNIS_Taglines > > > --- > Unsubscribe? Mail Majordomo@(protected) with the following text in > body: > unsubscribe xsi
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> <font color="#000066">I assume you just used Selection as an example, but to be clear, Selection is a collection already and can be used directly. .AddItems() can add an entire collection to another collection. .Add() will add a single object. Correct me if I am wrong here - Collections can only contain objects, so if you want to pass an object you know the name of but isn't stored to anything, you have to do one of the following:</font><br> <blockquote> <pre wrap="">var oCol = new ActiveXObject( "XSI.Collection" ); var oObj = Dictionary.GetObjcet( "my_3d_objects_name" ); oCol.Add( oObj ); <font color="#000066"> - or get and add the item the object directly -</font>
var oCol = new ActiveXObject( "XSI.Collection" ); oCol.Add( Dictionary.GetObjcet( "my_3d_objects_name" ) );
</pre> </blockquote> <font color="#000066">Arrays can contain strings <i>or</i> objects though. The only time I use collections is when taking the selection list as an input, or when an XSI functions demands it.<br> <br> - Rafe<br> </font><br> <br> <br> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<br> Bernard Lebel wrote:<br> <blockquote cite="midBAY15-F4psiYLZlmczB0005c314@(protected)" type="cite">Hi Rafaele, <br> <br> Try this: <br> <br> var oSel = Selection; <br> <br> oColl.additems( oSel ); <br> <br> <br> The additem also works well, but for single element. <br> <br> <br> Cheers <br> Bernard <br> <br> <a class="moz-txt-link-freetext" href="http://www.bernardlebel.com">http://www .bernardlebel.com</a> <br> <a class="moz-txt-link-freetext" href="http://www.xsimontreal.com">http://www .xsimontreal.com</a> <br> <a class="moz-txt-link-freetext" href="http://www.xsibase.com">http://www .xsibase.com</a> <br> <br> <br> <br> <br> <blockquote type="cite">From: Raffaele Scaduto-Medola <a class="moz-txt-link-rfc2396E" href="mailto:raffaele@(protected)"><raffaele @(protected)></a> <br> Reply-To: <a class="moz-txt-link-abbreviated" href="mailto:XSI@(protected)" >XSI@(protected)</a> <br> To: <a class="moz-txt-link-abbreviated" href="mailto:XSI@(protected)">XSI @(protected)</a> <br> Subject: Jscript question.... <br> Date: Fri, 19 Mar 2004 01:19:00 -0500 (EST) <br> <br> Does anyone have some sample code to put selected elements in a scene in a <br> XSI.collection objects. <br> <br> I'm looking for some information in the sdk docs, but having a hard time <br> finding it. <br> I basically am trying find out (in my script) the names of selected object <br> in my scene. <br> <br> Any pointers would be greatly appreciated. <br> <br> THX <br> RSM <br> <br> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ _____ <br> Raffaele Scaduto-Mendola - <a class="moz-txt-link-abbreviated" href="http://www .turbolinea.com">www.turbolinea.com</a> <br> <a class="moz-txt-link-abbreviated" href="mailto:raffaele@(protected)" >raffaele@(protected)</a> <br> --- <br> Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo @(protected)">Majordomo@(protected)</a> with the following text in body: <br> unsubscribe xsi <br> </blockquote> <br> __ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ <br> MSN Premium helps eliminate e-mail viruses. Get 2 months FREE* <a class="moz-txt-link-freetext" href="http://join.msn.com/?pgmarket=en-ca&page =byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS _Taglines">http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994 &DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines</a> <br> <br> --- <br> Unsubscribe? Mail <a class="moz-txt-link-abbreviated" href="mailto:Majordomo @(protected)">Majordomo@(protected)</a> with the following text in body: <br> unsubscribe xsi <br> </blockquote> <br> </body> </html>
|
|
 |