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 - Gayle

Pages: 1 [2] 3
16
I'm using EA V12 build 1230 and VB scripts to mark verification of packages, connectors and elements using TaggedValues.  For these items, I created a Tag that I use to enter the verification date (I also created some other custom tags to help track status of the items beyond the available information).  I can use my scripts to add, report and delete the tags.  I was hoping for something similar for diagrams, but I cannot find anything similar that I can use to mark when each diagram has been verified.

Is there any way to create TaggedValues or some maybe a custom property field that can be applied to a diagram and made visible when scripts access the diagram properties?  If not within EA12, but EA13, I'm working on that migration, so if there is something new I can use, I'm willing to speed up the migration.

Any ideas will be appreciated.

Thank you, Gayle

17
Bugs and Issues / V12 vs. V13 Hyperlink Format
« on: December 16, 2016, 10:51:34 am »
I'm reviewing how my architecture model looks when opened using EA V13 Build 1307.  The EA 12 Build is 1230.  So far, the only thing I'm seeing as a difference is with the formatting of Hyperlinks.  Most of my hyperlinks have an image assigned so that they look like a button.  There are a few that put a box around the hyperlink element and filled that box with a color using the default appearance functions.

I have captured some examples that can be sent, but I do not have the ability to insert them in this message.  In EA12, the "Change Records" and "Issue Records" hyperlinks have a black border and yellow/tan fill.  In EA13, the elements have those same appearance characteristics under default appearance, but they do not display with the border or fill.  I did a test to see if I could create a new hyperlink and format it with the same result (default appearance indicates border and color applied and display does not have them).

Is this a problem with V13 or do I need to update some setting that did not translate when moving from V12 to V13?

Gayle


18
Automation Interface, Add-Ins and Tools / Re: Find diagram by name
« on: December 06, 2016, 04:17:24 am »
Thank you.  That worked.

19
Automation Interface, Add-Ins and Tools / Find diagram by name
« on: December 03, 2016, 09:40:50 am »
I am using VB scripts within the 12.1.1230 version of EA.  My architecture model has a top level Model and under it several top level packages.  Within each top level package are numerous subpackages and diagrams going down several levels in the hierarchy.  All of the scripts that I'm working with have the user identify both the top level model and the selected top level package.  I have a new script query that asks for the desired diagram by name because I though I had some scripting logic to get the diagram ID if I had the diagram name.  I can't find any examples of locating the diagram by name if it is not at the first level under a specified package.  Assuming that the script user enters the correct name of a diagram that is several levels below the top level package, is there an easy way to locate the diagram?  Do I need to search through each model package to find the diagram?

I have the following logic to find a diagram under a specific package:
   dim thisPackage as EA.Package
   set thisPackage = Repository.GetPackageByID(4) ' fixed package ID for "Top Model" package

   dim thisDiagram as EA.Diagram
   set thisDiagram = thisPackage.Diagrams.GetByName("Diagram In Model")

This only works if I have identified the correct package that contains the diagram - in this example, the diagram is in the package ID 4.

I would like to find an easy way to:
1. Locate a diagram somewhere in the model by name - it could be several levels down in the hierarchy from the top level package.
2. Identify when the diagram is not in the current package

Any assistance will be appreciated.  Thank you.

Gayle

20
I now have the logic capturing the PDATA, parsing the string to insert "OpParams=2", concatenating the string back together and performing a "Repository.Execute" on the "Update" SQL statement.  The diagram now has the "Show Parameter Details" set to "Full Details".

Thank you all for your help.

Gayle

21
I was looking for the SQL Scratch Pad elsewhere in the tools and missed it under find.  When I used it, I did confirm that diagrams created with the script have no PDATA.  I just discovered that I can open the diagram, save the diagram and close the diagram before doing the SQL query and PDATA is populated.

Now to try and change the diagram properties!!

Thank you for the help.

Gayle

22
I am certain that I have missed something, however, I've never used the SQL Scratch Pad and don't know how to set my model up to use it.  The model is an eap file and the repository type is JET.

My logic in the script is relatively simple.  I ask the user for a UseCase name, create packages, diagrams and elements. The following is an example of how I have created a diagram:

   set newSD = currentPackage.Diagrams.AddNew(diagramName + " SD", "Sequence")
   newSD.Update()
   currentPackage.Update()

where "currentPackage" is the location that I want the diagram to go in and "diagramName" is the UseCase name that the user entered. 

I followed this with the SQLQuery:

   temp = Repository.SQLQuery ("SELECT PDATA FROM t_diagram WHERE Diagram_ID = " & newSD.DiagramID)
   Session.Output ("Diagram data - PDATA = " & temp)

The raw XML data that resulted from this query captured from the System Output window is:
   
Diagram data - PDATA = <?xml version="1.0"?>
<EADATA version="1.0" exporter="Enterprise Architect">
<Dataset_0><Data><Row><PDATA/></Row></Data></Dataset_0></EADATA>
   
Any ideas what I'm missing?

Gayle

23
I'm executing the script to create diagrams in a small test model.  To try and get the data associated with the PDATA statement, I created a small script to collect the data via SQL queries from the diagram that I have selected in the browser (I included diagram type and PDATA).  When I get PDATA for the diagrams created by the script, PDATA is blank.  I used diagram and package updates in the script, and the model (.eap file) has been closed and reopened at least twice since the diagrams were created.  Is there some kind of operation I need to perform on the diagrams once created to be able to retrieve PDATA and other values via SQL queries?

I was hoping to read PDATA and use it to make the update to the diagram properties.  For the update, do I replace the entire string that is read, or can I just update the "OpParams" field?

Gayle

24
I'm using EA 12.1.1229 and Visual Basic to write scripts.  The most recent script has generated diagrams and partially populated the diagrams.  For the Sequence Diagrams, I would like to set the "Show Parameter Detail" property under "Features".  The default is "Type Only" and I would like it to be "Full Details".

I created a pair of test diagrams - one with "Type Only" and the other with "Full Details".  When I do an XML export, the only field that appears to be changed is the "SuppressFOC" which is under the extended styles.  I could not access this value using the ExtendedStyle or StyleEx diagram class attributes.

I think that the ReadStyle and WriteStyle Methods could be used to read and write the style information.  However, none of my attempts to use these operations have resulted in updating the "Show Parameter Detail" to be "Full Details".  I could not find an example using these Methods, so I'm probably misunderstanding the information in the EA User Manual on how to format the operations.

I'm guessing that I'm missing something with respect to how to modify the diagram properties.  I found the "HighlightImports" to change the "Show Namespace" setting, but this "Show Parameter Detail" value does not appear to be as easy to modify.  Any ideas would be appreciated.

Thank you, Gayle

25
I found the problem with my script.  The table header used the document generation "DocumentPackage" option and when data was entered in the table, I used "DocumentDiagram".  When I changed the header to use "DocumentDiagram" the problem was corrected.

Gayle

26
Thank you for the idea.  I installed build 1229 and got the same results in the output table:
1. Root model level had no table header row regardless of whether script was run just after starting EA or after multiple executions of script.
2. Top package in root had one header row when script was run just after starting EA and 5 header rows for any other execution of the script.
3. Next level down package had one header row when script was run just after starting EA and 7 header rows for any other execution of the script.

The inconsistencies I'm seeing make no sense unless there is either a bug or I've missed something that needs to be initialized or reset each time the script is executed.

Gayle

27
I'm using EA 12.1 and Visual Basic Scripts.  I copied a working script that did many of the things that I wanted to do.  The existing script collected data on connectors in sequence diagrams within the model and generated and RTF with a single table that had one line of header row.  Two templates were used - one for the header and one for the body of the table (one line per connector).  Note that I was not successful trying to combine these into one template for the modified script.

My modified script is going into the same model and packages to extract data on diagrams and enter the data into a table contained in an RTF.  I created a new header row as a template (row marked in EA template as header) and another template for the diagram table rows.  I've tested this with three fixed packages:  the model root, a package under the root and a package another level down.  The package IDs are:  1, 4, 131.  When I run the logic on package 1, no header row appears.  When I run the logic on the first level package, I get one header row if EA is freshly started and 5 header rows if I have updated the script and saved it before running it.  For the next level down, I get one header row if EA is freshly started and 7 header rows if I have updated the script and saved it before running it.  There is very little different between the original script and the modified script except at the lower levels of the logic where it decides what data to collect for output to the file.

The script begins as follows (in this case, the root model is selected as the package and the lines for the other two are commented out):

dim DOCUMENTATION_TYPE, OUTPUT_FILE
DOCUMENTATION_TYPE = dtRTF
OUTPUT_FILE = "c:\\temp\\diagrams.rtf"
'
sub getDiagrams()

   'Show the script output window and clear window
   Repository.EnsureOutputVisible "Script"
   Repository.ClearOutput "Script"
   
   'Create a document generator object
   dim docGenerator as EA.DocumentGenerator
   set docGenerator = Repository.CreateDocumentGenerator()
   docGenerator.NewDocument("")
   docGenerator.SetPageOrientation(1) ' set output page to landscape   

   dim currentPackage as EA.Package
   set currentPackage = Repository.GetPackageByID(1) ' Root Package
'   set currentPackage = Repository.GetPackageByID(4) ' Model Package
'   set currentPackage = Repository.GetPackageByID(131) ' MT Package

   Session.Output "Package = " & currentPackage.Name & "; Package ID = " & currentPackage.PackageID

   'Create a heading for the table
   docGenerator.DocumentPackage currentPackage.PackageID, 0, "ExportDiagramHeading"
   
   'Find all the diagrams
   findDiagrams docGenerator, currentPackage
   
   'Save the document
   dim saveSuccess
   saveSuccess = docGenerator.SaveDocument( OUTPUT_FILE, DOCUMENTATION_TYPE )
   
   if saveSuccess = true then
      Session.Output "Documentation complete!"
   else
      Session.Output "Error saving file: " + docGenerator.GetLastError()
   end if

end sub

The findDiagrams routine has the following statement that is executed once for each diagram located in the desired package:

         docGenerator.DocumentDiagram thisDiagram.DiagramID, 0, "ExportDiagramDataxxyy"


My expected output would be one header row and one row for each diagram. I did not see how to attach a sample output to this message, but would be glad to add one if instructions are provided.

How do I get a single header row to show up in my output table consistently?  Is there something that needs to be reset or initialized that I've missed and we just got lucky with the script that another person developed?

Thank you for any ideas.

Gayle






28
Unfortunately, I'm not sure that multiple pages would work because I would need links on each page to navigate through the model.  Right now one diagram is 27 pages when printed to PDF and the other is 34 pages.  That is still on the back burner as a possible solution.

Gayle

29
Using EA12.1, I have a VB script that places elements on a "diagram" that is formatted as 8.5 x 11 inch pages.  There are more than 100 elements so I expect to have many pages in this diagram.  I have used diagramObjects.AddNew to insert class elements on these pages.  Each element uses a left margin location of 5 and right margin location of 805.  The elements are 200 tall and I have 10 pixels between the bottom of one element and the top of the next.  On the first page, I need the first element to be 90 pixels from the top so that I can have a diagram header and hyperlink back to another diagram.  For all of the other pages, the first element can be close to the top of the page.

The elements are created by the script and placed on the diagram pages.  The problem is that when I get to the bottom of each page, elements cross the page boundaries and become unreadable.  This model will be published as HTML and so I would like the pages to be formatted to be readable.  "Tweaking" element height and space between elements is too cumbersome, so I would like to write a loop to organize the elements on the diagram page, but I have not been able to determine page height.

Looking at the EA user manual and searching on the forum for previous questions I can't figure out exactly how many pixels per inch (or per page) I'm dealing with.

Gayle

30
I decided to try your suggestion and it resolved a problem that I encountered with the "Replace" function.  For some reason, I was getting an extra carriage return between the text "Trigger:  " and the data obtained from the SQL query.  This extra carriage return is now gone using the XML DOM tools.

Thank you for the suggestion.

Gayle

Pages: 1 [2] 3