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

Pages: [1]
1
Does anyone have SQL statement to retrieve the distinct IDs for the elements connected (start or end) to another element? For example, what are all the distinct element identifiers connected to the element with an identifier of 123?

SQL is not my strongest language and I would appreciate any assistance.

2
Any idea how I might toggle this via the API and not try to upsert directly into the database?

The style string approach is a bit kludgey but cleaner than mixing API calls with SQL.

3
I'm under the (possibly mistaken) impression that it is tied to the "Diagram>Properties>Diagram>Show namespace" toggle in the UI.

4
After I create the diagram, the list is empty, diagram.ExtendedStyle returns an empty string so there is nothing to replace. Do I have to make some other call to populate the ExtendedStyle property?

The above approach seems to work with ShowTags just fine. Is there some trick to setting "show namespace" with HighlightForeign?

5

Does anyone know how to turn off namespace on a diagram programmatically?

I am looking for something I can call on the EA.Diagram to turn off namespace display on diagrams I create.

I have a reference to an EAD.Diagram (diagram) being created.  I have a local class called UmlDiagram (umlDiagram) which is a generic type used to hold diagram properties. I can toggle tags with code like this:
Code: [Select]
string style = CompileStyle(umlDiagram);
if (style.Length > 0) {
    diagram.ExtendedStyle = style;
    diagram.Update();
}

... and a CompileStyle method like this:
Code: [Select]
private string CompileStyle(UmlDiagram umlDiagram) {
    StringBuilder b = new StringBuilder();
    if (umlDiagram.ShowTags) {
        b.Append("ShowTags=1;");
    }
    return b.ToString();
}

I thought I could add code to the CompileStyle method, but it appears that using ShowForeign=0; does not work like ShowTags=0; in the extended style string.

What is the proper way to toggle diagram appearance elements through the API?


6
Automation Interface, Add-Ins and Tools / Retrieve All Elements On A Diagram
« on: September 13, 2018, 03:10:54 am »
It is a simple as:
Code: [Select]
foreach (EA.DiagramObject diagramObject in diagram.DiagramObjects) {
    EA.Element element = Repository.GetElementByID(diagramObject.ElementID);
    // work with the element here
}

Thanks!

7
We are looking for a way to get a list of elements on the current diagram. This can be using code or SQL query.

It looks like using the DiagramObjects property on the Diagram class might be the way to go, but it is not clear how one might get the elements from this collection. Similarly, t_diagramobjects seems to be the table to query, but it's not clear how to parse element references from it.

Thanks in advance for any guidance!

8
Is anyone aware of how an add-in can be notified when an element is modified?

For example, I'd like to know when the user changes a tagged value of one of the elements. This would allow the add-in to check if it should perform any processing on the element based on the new tagged values.

Pages: [1]