LS

Hi,

I tried to change the font properties (e.g. color, size, font) of the model objects generated by my script, however I am unable to find a way to do that.

This is what I get at the moment:



These objects are created with

var lang = Context.getSelectedLanguage();
var model = group.CreateModel(Constants.MT_EEPC, MODEL_NAME, lang);

var group = ArisData.getSelectedGroups()[0];

var obj_definition = group.CreateObjDef(Constants.OT_FUNC, content, lang);
symbol[0] = Constants.ST_FUNC; model.createObjOcc(symbol[0], obj_definition, 0, 0, true);



I assume this is the most basic way to create such objects.

Could anyone please

  • Point me to the relevant documentation (ARIS Business Architect 7.2)
  • Tell me where I need to change the font properties (at model / group / object definition / object occurence  level)
  • and/or post some code that shows how to change the font properties?

Any help is greatly appreciated!

Thank you!

Laurent

 

by Laurent Seiler Author
Posted on Fri, 08/30/2013 - 12:33

Hi,

Just ran across the solution when I was searching for something completely different!

These are the few lines that you need if you want a black text color:

 

var lang = Context.getSelectedLanguage();
var db = ArisData.getActiveDatabase();
var fontStyle = db.createFontStyle("Custom Font Style", lang, true);
fontStyle.Font(lang).setColor(0);

or, if you want to build upon the current font style:

var lang = Context.getSelectedLanguage();
var db = ArisData.getActiveDatabase();
var fontStyle = db.defaultFontStyle();
fontStyle.Font(lang).setColor(0);

Hope this helps someone else then! :)

Have a nice day

Laurent

0
by Christopher Collins
Posted on Thu, 09/12/2013 - 20:50

Laurent,

I came across your discussion about the font colors, and you seem very knowledgeable when it comes to programming.

I am just starting to write scripts in ARIS, and I was wondering if you could point me in the right direction to where I could get the most help on this topic (whether it be books, websites, etc).

Thank you in advance!

Chris

 

 

0
by Laurent Seiler Author
Posted on Fri, 09/13/2013 - 11:32

Hi Chris,

In fact, I am not very experienced with ARIS and I only worked with ARIS for 2 weeks when posting this.

However, this pretty much sums up how I managed to learn ARIS scripting:

Hope this helps!

Laurent

0
by Paula De Guzman
Posted on Thu, 09/19/2013 - 08:14

Hi Mr. Laurent Seiler,

Good morning. I am an ARIS Administrator and I would like to seek your help in creating a script that will automatically apply a specific Template to a directory of models. 

I know that you can apply a template to a model one by one (Right click on the model, Format--> Apply Template). However, we have thousands of models in one directory and I was wondering if there is an easier way to do this? 

Thank you and hoping to hear from you. 

 

Thanks, Paula De Guzman 

0
by Harry Ratia
Posted on Tue, 09/24/2013 - 14:38

Hello Paula,

 

It is actually possible to apply a template on many models at one time. You can either select the models from a single group n ARIS Explorer if you have this structure. Or if the models are spred out in different groups, use the Find functionality to locate them. Thereafter you can apply the Template on the result by selecting them all and right-mouse click --> Apply template.

I hope this tip can help you to achive what you need to do.

 

Regards    / Harry

0
by Laurent Seiler Author
Posted on Thu, 09/19/2013 - 12:08

Hi Paula,

I'm sorry, I have never done something like that. However, I would try something like this:

// Get selected database
var db = ArisData.getActiveDatabase();

// Get all models. Constant documented in Help > ARIS Script > 
// Methods for reports and semanticchecks > Constants > FindConstants
var all_models = db.Find(Constants.SEARCH_MODEL);

// Get some template and modify it as you wish. Function found in
// Help > ARIS Script > Methods for reports and semanticchecks > Objects > Model
var base_template = all_models[0].getTemplate();
// ..... change properties. Don't know how to do that ......

// For each model, apply template
for (int i = 0; i < all_models.length; i++) {

    // Apply template. Function found in Help > ARIS Script > 
    // Methods for reports and semanticchecks > Objects > Model
    all_models[i].setTemplate(base_template);

}

I have not tried this, and I don't know if it works at all, but you could try and report back :)

Bye,

Laurent

0
by Deleted User
Posted on Mon, 09/23/2013 - 16:19

Hello Laurent,

if this works for you I would recommend using templates for this. Then you can easily apply the template via standard report to your models, and they will be reformatted based on the selected template.

Regards

MH

0
by Paula De Guzman
Posted on Thu, 09/26/2013 - 05:26

Hello to everyone, and thank you for your help. :)

 

Hey Harry, it's nice to catch you here in the ARIS Community! :)

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock