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.


Topics - RWHurra

Pages: [1]
1
Hello!

I use a document script to send elements to the document generator. In my template I have Child Elements ticked.

However no child elements are reported. I tried to send the child elements to the report through the document script as well but it just report it as regular elements, not as child elements to the element in focus.

Any idea what's going on?

Thanks!

2
Hello!

I have generated a report which traces to a document artifact.



Can I use this document artifact as a appendix in another generated report? Can I somehow make this document artifact a linked document to a package? That would make it really easy.

Thank you!

3
Automation Interface, Add-Ins and Tools / Element Usage list through API
« on: October 04, 2017, 07:46:18 pm »
Hello!

I am creating some documentation/reports via script fragments. I would like to show specific diagrams. My first idea was to iterate through the element usage list (ctrl+u) and send diagrams to the report based on the name of the diagram.

However I didn't find anything like ctrl+u in the API, and didn't find it googling/searching the forum either. Does anyone know a method to create a collection with the diagrams like ctrl+u?

Is there a better approach to select specific diagrams?

Thank you!

4
Hello!

I have a fragment in my document generator which finds element of interest with a SQL query. When I print the element's note the hyperlink is printed as a string instead as a hyperlink:

Code: [Select]
<a href="$element://{3D79297A-4128-4fdd-9070-3BA328E674F0}"><font color="#0000ff"><u>My element of interest</u></font></a>
This is no problem when inserting the note with the pre-built sections. Can I convert this html-string to an actual hyperlink in my documentation?

Thank you!

5
Hello!

I have an output to show connections to/from the current selected element as follows:

Code: [Select]
package >
HEADING 1 {Pkg.Name}
element >
HEADING 2 {Element.Name}
{Element.Notes}

connector >
source >
element >
{Element.Name}
< element
< source
{Connector.Name}
target >
element >
{Element.Name}
< element
< target
< connector
< element
< package


However, I would like to show it in a table:
SourceConnectionTarget
Source #1Connection #1Target #1




The problem is though that the information is in different section-contents (or whatever it is called, i.e. connector >, source >). I can't get all the information in the table. Is there a way around this?

Second question:
Is there a way to include the shapescript of elements/stereotypes? I found insert image and similar, but since the shapescript is embedded with the element/stereotype I thought it would be easy to show the image/shapescript. I do not find anything. Someone knows something about this?

Cheers!

6
Hello!

Where is my thought process off?

I have an on Diagram-script.

currentDiagram = Repository.GetCurrentDiagram(); (as EA.Diagram)
allObjects = currentDiagram.DiagramObjects; (as EA.Collection)

Code: [Select]
var listOfObjectNames = new Array();
var listOfElementIDs = new Array();
for (var i = 0; i < allObjects.Count; i++)
{
thisObject = allObjects.GetAt(i);
thisElement = Repository.GetElementByID(thisObject.ElementID);
listOfObjectNames.push(thisElement.Name);
listOfElementIDs.push(thisElement.ElementID);

}

allElements = Repository.GetElementSet(listOfElementIDs, 1);
listOfObjectNames.sort();

for (var j = 0; j < allObjects.Count; j++)
{
Session.Output(listOfObjectNames[j]);
allElements.GetByName(listOfObjectNames[j]);
thisObject = thisElement;
// Do stuff
thisObject.left = thisObject.left - 10;
thisObject.Update;
}
currentDiagram.Update;

My problem is the Collection.GetByName. At first I tried it on a collection with DiagramObjects, but I found in the documentation that:
Quote
GetByName(string Name)
Object
Notes: Gets an item in the current collection by name. Supported for Model, Package, Element, Diagram and element TaggedValue collections.
If the collection does not contain any items (or, for the Tagged Value collection, if the collection contains items but the method cannot locate an object with the specified name) the method returns a null value. For other collections, if the method is unable to find an object with the specified name, it raises an exception.
Parameters:
Name: String

Therefore I created a collection with Elements, through allElements = Repository.GetElementSet(listOfElementIDs, 1);. But I get the same error message. The end of this code snippet is kind of pseudo code.

The main problem is that I can't get Collection.GetByName to work.

Help?

7
Hello!

I made a small script to export a diagram as PDF. I know there is a setting in Diagram Properties > Diagram > Page Setup > Advanced > Scaled Printing: Scale to 1 Page which I use for larger diagrams.

I did some googling but didn't found any functions for this in the API. Is there? Or how can I change this setting with script, or make this setting default for a model/project?

Thank you!

8
Automation Interface, Add-Ins and Tools / List Composite Diagrams
« on: June 08, 2017, 11:19:02 pm »
Hello!

I am interested in adding a diagram as list in another diagram for navigation purposes. The default SQL search string is
Code: [Select]
SELECT
t_object.ea_guid AS CLASSGUID,
t_object.Object_Type AS CLASSTYPE,
t_object.Name,
t_object.Status,
t_object.Author,
t_object.Diagram_ID

FROM t_object
INNER JOIN
(t_diagram INNER JOIN t_diagramobjects ON t_diagram.Diagram_ID = t_diagramobjects.Diagram_ID) ON t_object.Object_ID = t_diagramobjects.Object_ID

WHERE t_diagram.ea_guid='{myElementGUID}'

ORDER by t_object.Name

By adding
Code: [Select]
AND NType=8

in the WHERE statement I get a list of all elements in the diagram with composite, or child, diagrams. However, instead of listing the elements I would like to list the diagrams. I have a hard time figuring out the SQL query for this search.

I should find all diagrams which is composite, or child diagrams, to the elements in the current diagram. With JScript and the API I could figure this out, but not with SQL.

Could I get some pointers?

Thank you!

9
Hello!

I would like to have the size of a vertical compartment on the left side fixed.


| xxx| ...............|
| xxx| ...............|
| xxx| ...............|
| xxx| ...............|

Extend the width would be:

| xxx| ..............................|
| xxx| ..............................|
| xxx| ..............................|
| xxx| ..............................|

My shape script today has two rectangles with 10% respectively 90%, this will be extended when the width is extended.

I hope you understand and thanks for your help!

10
Hello!

I have made a simple JScript to add a stereotype to selected elements in the project browser. The problem is that it only adds stereotypes, not remove current stereotype. The applied stereotypes just keeps piling up. How do I remove applied stereotypes?

Thanks!

Robert.

Code: [Select]
!INC Local Scripts.EAConstants-JScript
!INC EAScriptLib.JScript-Dialog


/*
* Project Browser Script main function
*/
function OnProjectBrowserScript()
{
  // Show the script output window
Repository.EnsureOutputVisible( "Script" );

     // Get the type of element selected in the Project Browser
     var selElem as EA.Collection;

     var input=DLGInputBox( 'Enter new stereotype', 'Multi-select element update', '');
     
     selElem = Repository.GetTreeSelectedElements();
     for (i=0; i < selElem.Count; i++) {
var e as EA.Element;
e = selElem.GetAt(i);
e.Stereotype = input;
Session.Output('Element changed: '+e.Name+' changed stereotype to '+e.Stereotype);
e.Update();
e.Refresh();
     }
Session.Output('All selected elements updated.');
}

OnProjectBrowserScript();

11
Bugs and Issues / Inherit background color in MDG Technology
« on: October 25, 2016, 01:01:51 am »
Hello!

I have an MDG technology where I create stereotypes which is a GENERALIZATION of Archimate2::ArchiMate_X and EXTENSION of metaclass x. I want my new stereotypes to inherit properties from Archimate, such as shapes and colors, however the background color will not inherit.

Comments?

Thank you!

12
Automation Interface, Add-Ins and Tools / Add in: get stereotype
« on: September 20, 2016, 04:49:10 pm »
Hello!

A few weeks ago a saw a post on this forum on how it is possible to create a add-in to allow shape scripts such as

Code: [Select]
decoration symbol {
    orientation = "SE";
Image("#STEREOTYPE#.emf",0,0,100,100);
}

However, I didn't know anything about creating add-ins and had to read up on that. Now I can't find the post regarding that add-in. I have searched this forum and googled like crazy...

Can someone help me with this topic or refer me to that forum post?

Thank you,

Robert.

Pages: [1]