Question about getting report from software to word doc

Starting point for “ask and learn more about MagicDraw”

Moderator: Moderators

Question about getting report from software to word doc

Postby hsui@gacrndusa.com » Thu Aug 30, 2018 11:51 am

I have a mode that I already finished in this Camero Systems Modeler software. I am trying to get a report from this software to Microsoft Word doc. I am using the 18.5 sp3 version and Microsoft 365 running by Windows 10 system. As I know and I understand, I have to create a code in word doc first. Then I can use the report wizard. However, I am having trouble with this code. Base on this mode is not alow to show other people. I will try my best to explain my questions.
1, I am trying to get a different type of diagram from this model in order. For example, I have a system block in this main tree. and there are several different types of diagram under this block. Such ibd, or something else. How can I set code to print as what I want?
2, Can I get an array for all diagrams?
3, If I can set an array of those, can I set them print in order?
I have some code, but I cannot make it run right now. Will you please help with me?

Code: Select all
1,
#foreach ($diagram in $Diagram)
#if ( $diagram.diagramType == "Class Diagram")
$diagram.name
$diagram.image
#end
#end
2,
#set($packages = $array.createArry())
#set($void = $arry.addCollection($packages, $Package))
#set($void = $array.addCollection($packages,
$Smartpackage))

#foreach($diagram in
$report.filterDiagram($Diagram,["Class
Diagram", "Communication Diagram"]))
$dia.image
#end

#foreach($dia in $Diagram)
#if($dia.name == "VDS"&& $dia.diagramType == 'Internal Block Diagram' )
#set($diagrams = $array.creatArry())
#set($void = $array.addCollection($diagrams, $Diagrams)
)
hsui@gacrndusa.com
Forum Newbie
Forum Newbie
 
Posts: 5
Posts Rating:0
Joined: Thu Aug 30, 2018 11:29 am

Re: Question about getting report from software to word doc

Postby sarawut_w » Wed Sep 12, 2018 11:19 pm

Dear Hehua Sui,

1, I am trying to get a different type of diagram from this model in order. For example, I have a system block in this main tree. and there are several different types of diagram under this block. Such ibd, or something else. How can I set code to print as what I want?

Code: Select all
##Get the System element
#foreach($system in $System)
$system.name
##Get owned diagrams from the System
#foreach($diagram in $system.ownedDiagram)
$diagram.image
$diagram.name
#end
#end


2, Can I get an array for all diagrams?

Code: Select all
##Get all diagrams in the project scope by $Diagram variable
#foreach($diagram in $Diagram)
$diagram.image
$diagram.name
#end


3, If I can set an array of those, can I set them print in order?

Code: Select all
##Use $sorter tool for sorting the diagram by diagram type
#foreach($diagram in $sorter.sort($Diagram, "diagramType"))
$diagram.image
$diagram.name
#end


I have some code, but I cannot make it run right now. Will you please help with me?

By the proposed code only without the sample/dummy model, we cannot make it worked fit to your model.
If you could provide the sample model and expected/drafted report, we could provide you a sample code that satisfy your needs.

Best regards,
Sarawut W.
Support Engineer
sarawut_w
No Magic
No Magic
 
Posts: 337
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am


Return to New to MagicDraw

Who is online

Users browsing this forum: No registered users and 0 guests