display diagrams [message #1828662] |
Tue, 16 June 2020 04:08  |
Eclipse User |
|
|
|
Hi,
I have been trying to function m2doc since days just to display the diagrams (system architecture, etc).
Too complex for systems engineers who cannot afford loosing time for creating a word document! There are no clear documentation...
I ended up with this piece of code attached.
I have no errors, but no image is displayed, only the logical elements names are there.
What should I do?
Thank you.
|
|
|
|
|
|
|
Re: display diagrams [message #1828699 is a reply to message #1828698] |
Tue, 16 June 2020 21:07   |
Eclipse User |
|
|
|
Hi,
Well, all this is documented in the documentation:
- The entry point for the M2Doc documentation: https://www.m2doc.org/ref-doc/3.0.0/index.html
- The M2Doc services you are using to get diagrams are documented here: https://www.m2doc.org/ref-doc/3.0.0/m2doc_service_m2docsiriusservices.html
- The fact that you have to add the NSUris is documented here: https://www.m2doc.org/ref-doc/3.0.0/index.html#services
But indeed, being able to write your own Word template with m2doc will require you to learn a few things including the AQL query language, so if you don't have time to do this, we offer training services or sub-contracting services to write templates for you.
Nevertheless, I am sorry that what I sent you is still not working for you. If you want more help, I would like to know which Capella version you installed and which m2doc version you installed, and then maybe you can attach your word template so that I can see if there is something wrong.
You can use asImage() and ASIMAGEBYREPRESENTATIONDESCRIPTIONNAME(), they will both get you an image, but these function does not apply on the same object. The reason why I am using asImage is that I used representationByDescriptionName which enables you to get the Diagram Representation object, not the image. On this object you can apply the asImage() to get the diagram image, but also .name to get the actual diagram name.
I hope this helps
Stephane
|
|
|
|
Re: display diagrams [message #1828701 is a reply to message #1828700] |
Wed, 17 June 2020 00:05   |
Eclipse User |
|
|
|
I understand now why you are struggling, you started over from an empty word document.
What I would suggest you is to start over reusing one of the example word document provided with the example project, it would make it simpler, just empty the content and start writing your document.
Nevertheless, if you still want to use your own word document from scratch, then this is feasible, here is the list of what you have to do, using "Edit Template properties", to add Capella's metamodels and other services.:
- add all Capella's metamodels in the "nsuri (expert)" tab (In the add dialog you can enter "capella" in the filter field then select every nsuris and add them), also keeping the one you already added previously
- add services you can use the "services (expert)" tab on the same wizard page and add: org.obeonetwork.capella.m2doc.aql.queries.M2DocGenServices
- click next and add a self variable with the value capellamodeller::SystemEngineering
Click finish to save your changes, you can now open the template in MS Word to edit it.
If you can't edit some of the properties, you can do it in word. Go to File->info and on the right, you'll see "Properties" and just at the end of this word, an arrow, click on it and go to "Advanced Properties" and then custom and there you can add properties.
Once again, it is much simpler to start with a word document already provided as an example...
A Custom Constructor is a Constructor you provide yourself in a Class.
I hope this helps
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: display diagrams [message #1858312 is a reply to message #1828662] |
Tue, 28 March 2023 10:39  |
Eclipse User |
|
|
|
Hello, I know it's an old subject but I've been using CAPELLA M2DOC recently and i had the same probleme you did. However, i found a way to display a diagram LAB for exemple, in an M2DOC generated document. Use the following request :
{m:'NameOfYourDiagram'.asImageByRepresentationName().fit(500,500)}
It worked for me
|
|
|
Powered by
FUDForum. Page generated in 0.12088 seconds