Author Topic: Brick uiName to brickName [Solved]  (Read 568 times)

Is there a way I can get the brick name from the brick ui name of a brick?

Code: [Select]
for(%i = 0; %i < DatablockGroup.getCount(); %i++)
{
%obj = DatablockGroup.getObject(%i);

if(%obj.getClassName() $= "fxDTSBrickData" && %obj.uiName $= %name)
{
//do stuff
}
}

This is one way. You could possibly do it through brickgroups, not sure though.
« Last Edit: June 11, 2013, 06:19:08 PM by swollow »

I guess you could search through the datablocks and look for a ui name that matches the one you have.

I guess you could search through the datablocks and look for a ui name that matches the one you have.
whats the name of the datablock group for bricks

Code: [Select]
for(%i = 0; %i < DatablockGroup.getCount(); %i++)
{
%obj = DatablockGroup.getObject(%i);

if(%obj.getClassName() $= "fxDTSBrick" && %obj.uiName $= %name)
{
//do stuff
}
}

This is one way. You could possibly do it through brickgroups, not sure though.

You won't want to loop through datablocks consistently though; if you need to do it more than once you should index them in an array.

You won't want to loop through datablocks consistently though; if you need to do it more than once you should index them in an array.
ya this was the plan

Code: [Select]
for(%i = 0; %i < DatablockGroup.getCount(); %i++)
{
%obj = DatablockGroup.getObject(%i);

if(%obj.getClassName() $= "fxDTSBrick" && %obj.uiName $= %name)
{
//do stuff
}
}

This is one way.
thanks! :)

Edit: Just to clarify the class name is "fxDTSBrickData"
« Last Edit: June 11, 2013, 06:18:54 PM by swollow »