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 - Aaron B

Pages: 1 ... 53 54 [55] 56 57 ... 60
811
Paolo,

See Package.FindObject(string).
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/package_2.html

The path passed to this function is relative to the package that you are calling from.  Can specify the path to a package, element, attribute or operation.

812
Unfortunately it is not possible to get/set Information Items Conveyed by an Information Flow connector from automation at this time.  I have logged this as a feature request on your behalf.  Sorry we could not be of more assistance.

813
Automation Interface, Add-Ins and Tools / Re: Attribute Alias
« on: June 09, 2009, 09:36:25 am »
The Alias for an Attribute is accessible through Attribute.Style in the automation interface.  See:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/attribute.html

I am not familiar with how this is represented in XMI, so I cannot comment on that.

814
Hello Fred,

DiagramObjects.AddNew() returns type EA.DiagramObject, not EA.Element.

A DiagramObject is an instance of an Element on a Diagram.

Try:
EA.DiagramObject nelem = (EA.DiagramObject)(currdiag.DiagramObjects.AddNew("",""));
nelem.ElementID = currelem.ElementID;
nelem.Update();

You do not need to specify anything for the Name and Type parameters of DiagramObject.AddNew(), but you can use them to set position information if you like as shown in the following example:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/addandmanagediagrams.html

815
You should be able to define a separator by simply using a hyphen.

E.g.  Array("Options", "-", "About...")

Should look like:

Options
-----------
About...

816
The following code can be used to add an existing element to a diagram:

Code: [Select]
Set obj = diagram.DiagramObjects.AddNew("", "")
obj.ElementID = element.ElementID
obj.Update

817
Repository.IsSecurityEnabled

This is not in the documentation with the current release, but will be in the help for build 845.

819
There was a bug in the automation interface where the XMIType parameter of ExportPackageXMI() method was not being correctly used.  XMI would always export as XMI 1.1.  This issue was resolved in EA 7.0 build 818.  Update your EA installation to EA 7.0.818 or higher and this issue should be resolved.  Make sure to reference the updated SSJavaCOM.dll and eaapi.jar files included with the new EA installation from your Java code.

820
The FindObject() method requires a dotted path to the element in relation to the current package.  E.g. "System.Class1".  If you only know the name of the object, but do not know which package it is contained in, you might try using Repository.GetElementsByQuery() instead.  This allows you to execute an EA model search and returns the results as a Collection.

Example:
  Dim results As EA.Collection
  Set results = Repository.GetElementsByQuery("Simple", "Class1")

821
There are some VB.NET code samples in the documentation that may help:
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/addandmanageelements.html

822
Automation Interface, Add-Ins and Tools / Re: Composites through API.  :(
« on: February 19, 2009, 04:25:04 pm »
It's possible to read a composite diagram from automation, but unfortunately not so easy to set one at this time.

From my understanding, you need to set Element.Subtype = 8, and need to add a row to the [t_xref] table in the database to indicate the guid of the default sub-diagram, which is only possible through direct sql interaction (which you can do, but we can't officially support).

823
To access a running instance of EA, you need to use the equivilent of the GetObject() call as shown in the VB example on the App page.  For C#, try something like this..

Code: [Select]
using System.Runtime.InteropServices;
...
object obj = Marshal.GetActiveObject("EA.App");
EA.App app = obj as EA.App;
EA.Repository rep = app.Repository;

824
Please read my previous response again.

You cannot cast an EA.Element object as EA.Requirement.  An EA.Element object of type "Requirement" is not the same as an EA.Requirement object.

825
Also, an EA.Requirement object is not the same as an EA.Element object of type "Requirement".  You should not try to cast it in this way.

An Element of type "Requirement" is referred to as an External Requirement, while object type EA.Requirement is for Internal Requirements (also called Responsibilities).  EA.Requirement objects are created using the Element.Requirements collection.

To understand the difference between internal and external requirements, see the following links:
http://www.sparxsystems.com/uml_tool_guide/what_is_uml_modeling/internalrequirements.html
http://www.sparxsystems.com/uml_tool_guide/what_is_uml_modeling/externalrequirements.html

To create a new Requirement Element (external requirement):

Code: [Select]
EA.Package aPackage = Repository.GetTreeSelectedPackage();
EA.Element element = (EA.Element)aPackage.Elements.AddNew("Test1", "Requirement");
element.Update();

To create an internal requirement:

Code: [Select]
EA.Element element = [...]
EA.Requirement req = (EA.Requirement)element.Requirements.AddNew("Test1", "Functional");
req.Update();

Pages: 1 ... 53 54 [55] 56 57 ... 60