How to replace a picture/bitmap to a model using script?

Translate this pagebookmark or share this page
Patrick's picture

Posted: 2012-01-06
1120 views | 4 comments | category: ARIS Community

0
show all articles

Hello All,

I am writing a report (running over a group of models) that will replace for each model an old company logo by a new one, but I'm not finding a way to replace a bitmap or a picture for all models within ARIS via a script.

Thank you very much in advance for your help.

Patrick

Comments
Vladimir's picture

Hi Patrick,

did you insert logo into model as OLE object?

Patrick's picture

Hi Vladimir,

Thanks for your response.

Yes, I have inserted logo into models as OLE object.

Regards,

Patrick

Vladimir's picture

Hi Patrick,

my example supposes a new company logo in model "Model1"

var g_nLoc = Context.getSelectedLanguage();    
var oModels = ArisData.getSelectedModels();

// get a new company logo from Model1            
for ( var m = 0 ; m < oModels.length; m++ ){
     if (oModels[m].Name(g_nLoc) == "Model1"){                                                       
         var curOleObj = oModels[m].ComObjOccs()[0];
         break;
     }
}

// copy a new company logo to other selected models      
for ( var m = 0 ; m < oModels.length; m++ ){                                                                         
     if (oModels[m].Name(g_nLoc) != "Model1") 
       oModels[m].ComObjOccs()[0].setCopyOf(curOleObj);       
}
Patrick's picture

Hi Vladimir,

Thanks a lot for your support Vladimir!

Regards,

Patrick