![]() ![]() jar of "" manually and - if yes - do you know where i can get them? ![]() ![]() I looked up my InstallationPath\magicdraw\plugins folder and here i cant find anything about "" or ".FileAttachmentsHelper" Var file = new java.io.File("C:/Test.txt") Ĭom.storeFileToAttachedFile(attachedFileElement, file) Ĭode: Select all MagicDraw cannot execute the nashorn macro, please make sure that the "Untitled." is correct. Var FileAttachmentsOwner = .("Path::to::my::Package::createAttachedFileElement") ĪttachedFileElement = .FileAttachmentsHelper.createAttachedFileElement(FileAttachmentsOwner) Var ClassToStoreFile = .AutomatonMacroAPI.createElement("Class") Sadly MagicDraw still cant execute the nashorn macro.Ĭode: Select all var CollectionsAndFiles = new JavaImporter ( // ImportĬom., Thank you for your response - you helped a lot. Var FileAttachmentsOwner = ModelHelper.findElementWithPath("Path::To::My::Package::ClassToStoreFile")Ĭomment attachedFileElement = FileAttachmentsHelper.createAttachedFileElement(FileAttachmentsOwner) įileAttachmentsHelper.storeFileToAttachedFile(attachedFileElement, file) Var ClassToStoreFile = AutomatonMacroAPI.createElement("Class") ĬtName("ClassToStoreFile") Var owner = ModelHelper.findElementWithPath("Path::To::My::Package") Create Owner for creating the ClassToStoreFile txt.Īfterwards i want to attache the file to it by declare it to the "owner" of it. Ok, i am now able to create an element (class) inside my package which should store my. The FileAttachementsHelper class provides a method called "storeFile".Ĭode: Select all FileAttachementsHelper.storeFile(elment, new file("C:/User/Desktop/RandomXLS.xls")Īfter executing, magicdraw says, that "storeFile" is not a function.īased of the quote from the user "marlel" ( post14365.html?hilit=Fileattachments#p14365) For best, this element which i want to attache the file should be genereated as well via the script.Īfter that, i want to interate throw the different rows and columns via Inputstream and substitute the content of the excel with each content (attribute names descriptions) of my model digramm.Ĭode: Select all ModelHelper.getComment Code: Select all tComment Code: Select all set.element ![]() The workflow for that is something like that:Īttache a excel sheet with the paths of the elements and their translated descriptions. Due to the fact, that i have a lot of entities and attributes i want to do that via a script (macro engine - JavaScript/Nashorn). Basically descriptions and names of entities/anttrbutes. I need to do some translations in my model diagram. I currently use MagicDraw 18.0 with an enterprise license. I just wonder how to add the FileAttachementsHelper plugin to my magicdraw environment. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |