Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - PeteEA

Pages: [1]
1
General Board / Re: Relationship Matrix
« on: August 21, 2020, 09:53:33 pm »
Not so far as I have found - it's one or the other, which is a shame. The only way I have found of getting both is through jiggery pokery by exporting to excel in alias mode and using lookups from csv exports of the element names and aliases.

2
I've accidentally found that if I BOTH extend my stereotype from a Class metaclass (with the _HideUmlLinks set to True) AND generalise it from the SysML1.4 that my stereotype pickups of the SysML block customisation (as far as I can see that is only the isEncapsulated property) and the blocking of the default quicklinker, allowing me to customise on a per diagram type basis using the contents of the diagram toolbox.

As that works, I'll go with this option unless there is a good reason that anyone can say I shouldn't do this.

3
Is there a way of applying this to stereotypes that are Generalisations of a SysML block?

I added _HideUmlLinks, set to True on a SysML1.4::block from which I have more specific stereotypes, but it didn't work as the generic block quick linker options were present (I then realised the SysML1.4::block is not a metaclass). I tried adding the Class metaclass (with _HideUmlLinks, set to True) and extending my SysML1.4::block from that (that didn't work - I didn't really expect it to as I probably shouldn't be able to override SysML).

Obviously if I extend my block from my new Class metaclass then the generic links are hidden as expected.

4
Automation Interface, Add-Ins and Tools / Re: MDG installation
« on: June 17, 2020, 11:25:36 pm »
Same filename means without the extension. E.g. if the wizard pattern is ABC.xml then the RTF description needs to be ABC.rtf. It's probably also a MUST - how otherwise would EA know which RTF to associate with with pattern XML, in the absence of any means to specify?

My experience is that the RTF also had to be in the C:\Program Files (x86)\Sparx Systems\EA\ModelPatterns folder along with the pattern XML file, otherwise the RTF doesn't get displayed. The RTF file doesn't get displayed if the XML and RTF file are located using an absolute path - this is obviously a bug as the XML pattern can be accessed from an absolute path and a shame as it makes it harder to share as individual users need to put the file within their installation directory and repeat that each time changes are released.

5
I'm trying to build a document of the details of all conveyed items on connectors connected to an element - it seemed easiest to pass the element to the document script, iterate the connectors of the element, iterate the conveyed items and then build the document as the script progressed.

I'm including the connected element in the heading.

So this morning, I've looked at using a script fragment - if I passed the connector in then I could build it section by section, running a script on each connector and returning the conveyed items in XML, but it looks like the Template Fragment can only work on an element (Insert Template is only available in the "element>" section and not the "connector>" section of a document template). So I'd have to pass the element to the script, compile XML with each connector, the source or destination element and any conveyed item details, to build back up in the document with certain parts as headings.

I've only used a script fragment to return one or a small number of elements in one section of a document, with the small template repeated for every element.

At first sight it looks like it would be harder to build the XML to get everything in the right place in the document compared to building the whole thing in a Document Script.

Should I switch to a Script Fragment?

6
I am creating a custom document output using a document Fragment with Document Script. I'm using Repository.CreateDocumentGenerator to create the document.

Most of it gets created fine. The sticking point are the Notes fields - they may include bold, bullet lists etc. Simply adding the Notes property results in the formatting being HTML-like (e.g. <B> for bold text </B>) and included in the final document.

A partial solution is to use Repository.GetFormatFromField("RTF", element.Notes), save that to a temporary file and then use reporting.LoadDocument to include that RTF formatted text in my document section.

The problem is that the font style changes - while text generated using reporting.InsertText, reporting.InsertLinkedDocument and the export to a file are identified as "Normal", it seems like there are two different definitions of Normal in the final document, which I didn't realise was possible. InsertLinkedDocument  and export RTF/LoadDocument are one type of Normal font setting while InsertText is a different Normal font setting. Having written this I'm not even sure that EA is showing the paragraph style correctly in the document editor - everything I put the cursor on is Normal, even if I change it or select a line that is specifically a heading! (so maybe they are not all being generated as Normal even though it looks like they are).

I am happy to change tack completely - all I want to achieve is to getting notes with their formatting included in a Word output and all other text generated in the document in the same font style.

7
General Board / Re: Document Generation
« on: June 02, 2020, 05:05:13 pm »
I think you should be able to acheive it with the element filter in the document generation:
Open Generate Documentation on the package you want to generate the documentation for, click on Element Filters, then Add Filter, select Add Filter and Required against Phase and select the Condition as One Of, putting 1,2,3 in the value box.
I haven't tried it but think it will work.

8
General Board / Re: Practical way to do reviews
« on: May 27, 2020, 11:37:25 pm »
Have you considered the Collaborate window (Start - Discussions - Discuss in 15.2).

You can annotate a review point against any element (but seemingly not a relationship - informally I guess you could pick the source element).

Then under Start - Review - Review History - Discussions you can see all the comments made.

I've used that to review a model with a colleague.

9
That suggestion works perfectly. I used to know a bit of VB, but it's long escaped my memory!

10
I'd like to create an input dialog with the prompt on multiple lines. I'm using DLGInputBox from EAScriptLib.JScript-Dialog.
I've tried including \n or String.fromCharCode(10) within the prompt parameter. Both cause the same error "Unterminated string constant" on the vbe.eval line.

As far as I can tell from VBScript info, including either CR or LF within the prompt should give a multi-line prompt

Just to be sure, I created the code manually without using the library code, with no change:
      var vbe = new ActiveXObject("ScriptControl");
      vbe.Language = "VBScript";
      DLGInputBox('A'+String.fromCharCode(10)+'B',"Title","Def");

Is there a way to get a multi-line dialog to work? I'm not restricted to this VB dialog if there is an alternative that will work (I have tried Session.Input and that silently ignores the newline.

11
Automation Interface, Add-Ins and Tools / Stopping a script
« on: May 20, 2020, 08:31:35 pm »
How can a running script be stopped?
I've got a bug that caused a never ending loop but could not find a way to stop the script - I just closed EA but thought there must be a better way (I wasn't running in the debugger).

12
I want to change the appearance of my elements depending on stereotype. According to the MDG guide, when testing a property in a Shapescript image definition, the propertyvalue parameter can have multiple values, separated by commas. The example uses the "Type" property and I have proved that works: if(HasProperty("Type","Class,Action,Activity,Interface")).

What I actually want to do is: if(hasproperty("stereotype","StereoA,StereoB"))

This doesn't work. If I put just one stereotype StereoA or StereoB as the property value then the rest of my shapescript works, but if I put both in then it doesn't apply to either. Both of these stereotypes are "generalised" from a more generic stereotype where the shapescript is defined.

Are multiple property values not allowed for the stereotype in a hasproperty statement?

Alternatively is there an OR concept in the shapescript language - I can't find it and just trying it doesn't work.

I realise that I can probably sort it with multiple if/else statements, but I'll then need to repeat sections multiple times.

13
If you go to Start - Desktop - Visual Style and untick "Enable Concise Diagram Navigation" then I think that achieves what you want, opening linked diagrams in new tabs.

Pages: [1]