Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've often run into this problem where I've got an array of face stored in a variable, but I want to substitute a new object name. I've seen this accomplished online, but I don't understand the code because it's written in short hand. Could someone help me figure this out.
//Store faces from first object
string $components[] = `ls -sl -fl`;
//Get name of second object manually select here this is just an example
string $obj[] = `ls -sl`;
//Loop through array swap names
string $newComponentSel[] = {};
for ($item in $components)
{
string $comp = `match "\\..+" $item`;
$newComponentSel[size($newComponentSel)] = ($obj[0] + $comp);
}
select $newComponentSel;This code works, but I don't understand the second line $newComponenSel[size($newComponentSel)] could someone write that out for me in long hand?
Solved! Go to Solution.