Help with Automating Tasks with Macros

Systems engineering related questions and discussions.

Moderator: Moderators

Help with Automating Tasks with Macros

Postby depue.thomas@gmail.com » Mon Apr 26, 2021 2:08 pm

I am attempting to create a macro (leveraging Jython but indifferent regarding the language - would happily switch to Java if for whatever reason its easier for example) to take an existing presentation element of a comment for example and add it to every diagram in the model (eventually only to certain types of diagrams and hopefully add some code to check if it already exists and only add it where it doesn't already exist so it can be run periodically to update diagrams without the comment on it). I have been digging through the limited documentation I can find online and have not been able to find a way to do this. I am not stuck on using a comment, I have been able to create a "rectangle shape" or a note but unable to populate the desired text in the newly created element. Similarly it would be great to be able to add a diagram to each diagram as well, like linking each back to the top level package diagram for example, hoping finding a solution for one of these opens the door to automating numerous currently manual tasks.

Does anyone know of any good resources of information regarding writing macros preferably with examples? Or might possibly be able to assist in creating a macro of this type?

The model I am working in is quite large and manually dragging and dropping a comment from the containment tree feels unnecessary and time consuming and something that would need to be checked from time to time to ensure all new diagrams contain this comment moving forward... Any help or direction would be greatly appreciated!!

If this one is not seemingly possible, I am in general trying to learn more about macros in MagicDraw that don't necessarily have anything to do with the report generation so any sources of info or help in the broader sense would be appreciated as well!

Thanks!
Tom
depue.thomas@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Mon Apr 26, 2021 1:56 pm

Return to Model Based Systems Engineering (MBSE)

Who is online

Users browsing this forum: No registered users and 0 guests

cron