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

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Bookmark through API interface
« on: October 30, 2008, 07:58:00 am »
Is there a way to Bookmark a package through the API automation interface.  I can bookmark an item through the UI.  In the API I haven't seen anything that even remotely looks like it will bookmark an item.

Thank you.
Kalvin

2
Is it because of capitalization of styleex, should be StyleEx?

Kalvin

3
Automation Interface, Add-Ins and Tools / Re: Automating Expose Interface
« on: October 22, 2008, 02:34:49 am »
I am posting the answer to my question for anyone else that runs into this.  It was provided to me by Sparx support people.

This is the answer to the problem of Expose Interface through creating a ProvidedInterface in automation.

This code will get access to an existing interface and the component that will expose that interface.
Then, create the Exposed interface.
Finally, update the changes to the model.

Code: [Select]

// Get references to existing elements
EA.IDualElement mainComponent = (EA.IDualElement)package.Elements.GetByName("MainComponent");
EA.IDualElement componentElement = (EA.IDualElement)package.Elements.GetByName("NewComponentToExposeInterfaceOn");
EA.IDualElement baseInterface = (EA.IDualElement)mainComponent.Elements.GetByName("BaseInterface");

// Create new interface
EA.Element newExposedInterface = (EA.Element)componentElement.Elements.AddNew("NewInterfaceName", "ProvidedInterface");
newExposedInterface.ClassfierID = baseInterface.ElementID;

// Update changes
componentElement.Update();
newExposedInterface.Update();


4
Automation Interface, Add-Ins and Tools / Automating Expose Interface
« on: October 17, 2008, 05:00:08 am »
I am trying to Expose an interface on a component through automation.  

I create a new element with a type of "Component" named newElement.
I create a new element with a type of "Interface" named newInterface

Then I make a call to newElement.EmbeddedElements.AddNew(name of new interface, "ProvidedInterface").  The Provided Interface is in the model but it is not linked to the original interface.  I should be able to add a new Operation to the Interface Component, then create a message to that operation on a sequence diagram.  But the new operation doesn't show up.  I can do this through the EA UI, but Automation isn't working.  Please help me understand what I am missing in automation to make this work.

I have tried calling Update() and Refresh() after creating each element, but that doesn't change anything.

Thank you.
Kalvin

5
Thank you very much for the reply.
I considered the Tagged Value but I couldn't see a way to create a tagged value for a diagram.  It looks like this is the only type of object that doesn't support tagged values.  I also looked at Custom Properties, but the diagram doesn't support those either.

Kalvin

6
I am trying to create different types of objects (packages, diagrams, links) in an EA Model through automation.  I would like to tag all of the objects with a value saying it was created through the automation program.  I have so far been unlucky in finding a property that is available on all object types.  It would be nice if there was a way to create a custom attribute in the automation.  The value created does not need to be visible in the EA UI.  It just needs to be accessible in the automation program.  Is there a way to add a custom property for any object type?  Is there a better way to do this?

Thank you.

Pages: [1]