Hi,
I have got a request to export EPC as a graphic file like JPEG or some other common format. However, it seems ARIS Script only supports doc/pdf/xls/rtf/txt/html format. I noticed that when exporting EPC as html, a png file would be created. Does any one know how to get the png file directly using ARIS script?
Thanks in advance.
Regards,
Will
Eva Klein on
Hi Will,
First, you need to specify which model should be exported. This is done as follows:
Then you need the method “createOutputObejct()”, which returns a new output object with preset name, format, and media size .
Getting the graphic of a model can be done by calling the Graphic method of the model object. This method uses three parameters. The first parameter means that the object is always visible on a part of the graphic. The second parameter defines whether the returned graphic should be black & white or contain colors (false = color, true = black and white). The last parameter specifies the language to be returned.
The method“Save()” saves a picture object as an EMF, PNG, or JPG file. In our example the picture is saved as a png
Everything else is just iterating over the list of models, etc..
var models = ArisData.getSelectedModels() var outputDummy = Context.createOutputObject() for(var i=0; i<models.length; i++) { var picture = models[i].Graphic(false, false, Context.getSelectedLanguage() ) var imageFileName = "ModelImage_"+i+1+".png" picture.Save(outputDummy, imageFileName) Context.addOutputFileName(imageFileName) Context.setSelectedFile(imageFileName) }Make sure to watch the Reports & Macros group. There you will find additional tutorials which will help you to get started with ARIS scripting.
Regards
Eva