AA

Hi, my problem is getting object symbols without name on them.

This is the result that I got

But I need to get a result like shown below

If someone knows the solution, please share script with me

Thanks

Arda Ay

by Kay Fischbach
Posted on Mon, 10/08/2018 - 07:20

Just to be clear, did you create those object occurrences with a script and those empty ones are the final result, or do you just happen to have one or more models which look like ones shown above for whatever reason and are now tasked with fixing them?

If it's the former, I assume you've used

Model.createObjOcc ( int SymbolNum, ObjDef objDef, int X, int Y )

to create the object occurrences. Don't use that method. Instead use

Model.createObjOcc ( int SymbolNum, ObjDef objDef, int X, int Y, boolean bCreateAttrPlacements )

and let the bCreateAttrPlacements be true. The description of the second method I mentioned says in the ARIS Script documentation that the last parameter is "false" by default, which is why if the parameter is omitted you wouldn't get any attribute placements (such as the name).

If it's the latter, and you were just given the models to fix them, you can either do it with a script, or maybe the format template already does the trick for you too (if the template is correctly set up, with the "Name" attribute occurrence set as a default). Just open the model, select all the occurrences for which you want to apply the template, and then in the tab "Format", there is a box where you can set the template.

You (or one of your colleagues if you don't have the permission) can check if the template is correctly set up beforehand, by going to ARIS > Administration > [tenant name] > Configuration > Conventions > Templates > right click [Template name] > Edit > click next until you reach the assistant step "Place symbol attributes" > in the list of symbols look for and select the symbol type you want to check/fix > in the lower field "Placed attributes" it should say "Name".

0
by Arda Ay Author
Posted on Mon, 10/08/2018 - 09:03

In reply to by Kay Fischbach

Hi Kay, thanks for your answer

I have a model with objects on it and my task is printing them with using script. Your script is about creating new object occurrences I guess, but they are existing, I just need to take them and print in order. 

As you see, I have problem to print names on graphic. Is there a known way to do it?

0
by Kay Fischbach
Posted on Mon, 10/08/2018 - 11:08

In reply to by ArdaAy

Does the original model (the one on which you invoke Model.Graphic ( boolean CutObjects, boolean BlackWhite, int localeId ) to get the graphic that you can add to the output) contain object occurrences with placed attribute occurrences (with the name shown)?

Edit: aditonal question: do you use an evaluation filter?

0
by Arda Ay Author
Posted on Mon, 10/08/2018 - 13:29

In reply to by Kay Fischbach

Hi Kay, thanks for your answer,

I used Model.Graphic() function to take model's picture, but I need to take all object's picture separately.

I used filter like shown below,

 <pre class="brush: jscript">

var filter = ArisData.ActiveFilter( );

var connTargetGraphic = filter.SymbolGraphic( connTargetSymbolNum );

var connSourceGraphic = filterSymbolGraphic( connSourceSymbolNum );

</pre>

Also, I uploaded my script, I will be glad if you check it

Thank you

Arda

File attachments
0
by Ariene Kroeze
Posted on Mon, 10/08/2018 - 14:46

I think you need some code like this:

var lAttr = lObjOcc.ObjDef().Attribute(Constants.AT_NAME, -1)
if (lAttr.IsMaintained()){
    
            
    var lAttrOcc = lObjOcc.AttrOcc(Constants.AT_NAME)
    var lPort = Constants.ATTROCC_CENTER
    var lFontStyleSheet = GetDefaultStyleSheet()        
                   
    lAttrOcc.Create(lPort, lFontStyleSheet))
}
        

function GetDefaultStyleSheet(){
    var lDefaultFontStyleSheet = null
    var lFontStyleSheets = ArisData.getActiveDatabase().FontStyleList()    

    for (var i in lFontStyleSheets){
        var lFontStyle = lFontStyleSheets[i]
        if (lFontStyle.IsDefaultFontStyle()){
            lDefaultFontStyleSheet = lFontStyle
        }break
    }
    return lDefaultFontStyleSheet
}

 

Regards, Ariene
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