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 - Mike Chapman

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Re: Updating Notes field
« on: October 15, 2010, 01:03:11 am »
Don't know if this is just stating the obvious, but just in case...  I would not expect it to work on a top level package, they do not support adding or editing notes even through the GUI.  

2
Interesting idea!

I could require users to create their models in this way.  Not super friendly.

Or I could create and maintain this ubermodel myself.  

I don't suppose that this could be done invisibly, eh?  The users will see the reorganization, which could surprise them.

Now you've got me thinking about generating stuff in the model to store metadata.  Another possibility would be to create a separate top level model with a sub-project, which would have an associated element, and that's where I could add my tagged values.  At the cost of one out-of-tree visual wart, I can store data and the user's models are unaffected.  

I don't have any experience with real Sparx users, which idea do you think would be less annoying/disruptive?


3
I would like to store some application specific data in an EA model.  It is to be used by our plugin and ideally would not be seen or editable by users.

I thought that tagged values would be a reasonable mechanism to use (I realize that they are in fact visible and editable, so we'll give them ugly and obscure names), since they can be found on Elements and Attributes.  They are also available on Packages, via that special Packages.Element interface that finds the 'special' Element associated with a Package (the one that has the same GUID as the Package).

But for some reason, Package.Element is always NULL on the top level Model packages.  Ironically, that is the first place that I want to store something in.   :(

I don't think that I can force the creation of one of these Elements, as I'd need to set the GUID to be the same as the associated Package, and the typical Collection.AddNew() would not work because they're not in a collection, just a single reference.

So my question is... can I make EA create an Element on Model packages?  Or is there a better, more elegant (to be honest, I'd settle for reliable) way to store application data in an EA model?


Edit:  Strange, I notice that on the top level Models (visually the top level ones in the Package Explorer), you are not able to set any properties, even through the GUI... like Notes, etc. I don't even see 'Properties' on the context menu for the top level models.

I have a feeling that this restriction is somehow related to the one I'm seeing in the automation interface.  Why not allow folks to set properties at the top level?  I think I'm missing something basic here.

4
Automation Interface, Add-Ins and Tools / Re: Setting a Bookmark
« on: October 13, 2010, 05:49:45 am »
Ah, thanks for the opinion on bookmarks, put that way, they don't seem to be as good of a fit for pointing out changes as I would have liked.

The status idea is a good logical fit, but it's not visible through the Project Browser.  To raise visibility in the Project Browser, I tried making some color changes via Element.SetAppearance() but nothing happened, so as a fallback hack, I am annotating the element name with a tag indicating changes as well.  Good enough for a demo...

5
Automation Interface, Add-Ins and Tools / Setting a Bookmark
« on: October 02, 2010, 04:27:09 am »
I understand that bookmarks are a "great way to flag changes" in the model.

Does anyone know if there is a great way to set a bookmark through the automation interface?

I see some ways to alter the visual representation of an object (ex  Element.SetAppearance(), DiagramObject.Style), but I don't see any reference to bookmarks in any of the interface descriptions that I'm (sort of) familiar with.

Thanks in advance for any light you can shed on this.  It appears that Bookmarks have been around since 2007, so I'm thinking it's quite possible that I am just not very good at finding things in the API documentation.

6
Automation Interface, Add-Ins and Tools / Re: Saving a Diagram as an image
« on: September 28, 2010, 01:14:18 am »
Aha, I was not looking at the Project interface, thank you!

I don't want to depend on what the 'current diagram' is, so I will use the PutDiagramImageToFile(guid, filename, type) method so I can specify the guid of the diagram that I want to export.

Again, thanks for pointing me at the right interface.

7
Automation Interface, Add-Ins and Tools / Saving a Diagram as an image
« on: September 23, 2010, 01:47:33 am »
Greetings from a novice EA automation hacker.  I would like to programmatically create an image that represents a given Diagram.  Exporting it to a file would be just fine.

I see the functionality that I want in the Diagram->Save Image menu item, but I don't see it in the automation interface.  Did I miss something?

If the functionality I desire is not available to me directly, then is there a way to invoke menu functionality through an automation interface?  I saw suggestions of throwing Windows events at the application, or faking key events, in another thread.  Trouble is, this would not just be a simple menu invoke, but interaction with a dialog afterward... and that would make it more ugly and brittle, I would think.  Maybe not even feasible, I'm not sure.

Pages: [1]