Scripting: static collection 2004-03-09 - By Bradley Gabe
Back Some basics on OOP. You'll need to get a firm grip on the difference between assigning pointers to objects, creating objects, running object methods, and getting/setting object properties.
ch_coll = new ActiveXObject( "XSI.Collection" ); // Creates a new XSI Collection obj pointed to by ch_coll. ch_sel = selection ; // Points var ch_sel to already existing Selection object. ch_coll = ch_sel ; // Points var ch_coll to same thing ch_sel is pointing to, selection.
// What you've done is create an object, then lose it by reassigning its pointer to something else.
ch_coll = new ActiveXObject("XSI.Collection"); // Create a new XSI Collection obj ch_coll.AddItems(selection); // Populate the new collection with items from selection object.
// Once the AddItems() method is run, your ch_coll is set and won't do anything until you add or remove items.
>Hello, > >I'm trying to go all OOP, so please be indulgent. > >In Jscript, I'm trying to use ExtractFromComponents while looping through >aselection of geometries and then looping through their respective clusters. >As soon as a new object is created, it becomes selected, screwing up my >outer loop. How do get the selection collection to remain fixed to what it >is at the beginning of the script? I tried copying Selection into a new >collection, with > > ch_coll = new ActiveXObject( "XSI.Collection" ) ; > ch_sel = selection ; > ch_coll = ch_sel ; > >and looping through the second collection, but the same thing happens... ??? > >Christian Rittener > >--- >Unsubscribe? Mail Majordomo@(protected) with the following text in body: >unsubscribe xsi > > >
-- Bradley R. Gabe Industrial Light & Magic
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|