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 - «Midnight»

Pages: 1 ... 373 374 [375] 376 377
5611
Automation Interface, Add-Ins and Tools / Re: How to deploy Add/Ins
« on: April 21, 2006, 06:30:38 am »
For .Net assemblies to be 'friendly' with COM you need to set one or two properties. I don't have them handy, but MS docs (if not the EA ones) should tell you. This forces the .Net compilers to include information necessary for COM registration.

5612
I remember something about this from before.

It was some time ago, and I think the bottom line was that keywords could not be written via the automation interface. [Of course you could read the database field directly, but that's not what I'm talking about.]

I don't remember whether I found anything about this in the forum, but take a look at the MiscData property of the Element class in the Automation Reference section of the user guide.

You'll note that this property (array) is read-only.

Of course I needed to write this, and at the time EA opened Access files with an exclusive lock, so I switched to a repository and wrote a separate channel to the database. Sparx probably wants to keep this carefully guarded until the next global revision of the schema, so we may have to live with this limitation for some time.

David

5613
While you wait for the link to magically (or otherwise, but what's the chance of that?) reattach itself...

Here's a (perhaps very) long shot. If you're a Java person, and if you have Eclipse up, then take a look at:
http://update.xmlmodeling.com/updates/index.html

(Another) If I read it correctly this purports to be able to render an .mdl file into XMI. I don't know the dialect, but with any luck at all it can be imported into EA. After all, if they aren't simply importing the model directly, one might hope they are trying to maintain compatibility with the myriad tools out there that read Rose extracts, EA among them.

I used this thing a bit during its infancy, when I needed something that ran on Eclipse and read models from other tools - requirements a client imposed. At the time (quite a while ago) nothing really measured up so we abandoned the search and took another approach. I went back to EA and created translators. Since then EA has provided most of the functionality from the other side of the equasion (i.e. into versus from the Eclipse 'side' of things); meanwhile the client has adopted EA as their standard platform for a variety of reasons.

Still, if it gets you out of writing a custom XMI generation or import tool, go for it! I have written both, and truely appreciate the 'benefits' of any approach that avoids doing so again.

David

5614
Check out the user manual under the Project Interface / Project section of the Automation and Scripting / Automation Interface / Reference.

I am using the manual from build 789. In the .pdf file it is page 1204 (the numeral on the page) or 1233 of 1362 at the bottom of the adobe reader screen.

The documentation is not too much help, but nor is it for what these variables mean when you are doing layout by hand. Still, you shold be able to manipulate all the layout settings via this function in the same way as you could by hand.

I'm sorry to say that all the usual cautions apply, and you'll have to do some experimentation. Still, I can often get a reasonable first cut at a 'reasonable' layout on small diagrams. At least it gives users something to work with.

I don't think the recent capability to layout only selected elements has made it through to this interface. However, you could try selecting some elements via automation and calling the function. If you do try that and it works, please let me know on this thread.

David

5615
That makes my day Vagabond!

Now that I read your "found it" post I dimly remember seeing something here about having to come back into EA...

This forum really does have a wealth of good stuff. It is usually worthwhile to do a search or two when you're stuck. Having said that, the search function is well known for its tendency to be 'selective' about what it reveals. Just because you cannot find something doesn't mean that its not there, nor does it necessarily mean you failed to search well; sometimes the search engine simply won't tell you.

We're always here to help (or at least listen  ;) ).

David

5616
Hey Vagabond,

Take a look at this thread:
http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=Automation;action=display;num=1138672679;start=1#1
Can't say for sure since I don't use this particular tool, but it sounds like the same thing.

Please remember to report back on whether it works.

David

5617
No, this is a way that was envisioned.

Your cx and cy values refer to a page size of 800 by 1100 hundredths of an inch. I also suspect that someplace (EA or Windows) you've got a mapping between A4 and Letter size.

The position of any specific DiagramObject (DO) may be outside of these values, since the DO in question may not be on the top left page.

Remember that the cy decreases towards the bottom of your canvas, and is negative. Depending on how wide and tall your overall used area is the coordinates may be a fairly large in magnitude. Try a small model, or query one you've created by hand, and see what you get. Try looking in t_diagramobjects.

David

5618
Here's a useful test. Create a new diagram, and retrieve or set its page size programmatically. Then compare with how big the diagram says it is in the EA properties window (F5).

5619
The units appear to be the same ones Sparx uses for page sizing. Look in the user guide for this. It may be in the documentation section - I can't remember, and I last looked back in version 4.1.

Also, the Y coordinate appers to increase from bottom to top, as a cartesian diagram on paper would. You may have to play around a bit to get the feel of it.

Finally, if the EA drawing engine feels your element does not have a 'reasonable' size (this is not defined anywhere) it will size the object on its own. This can produce fairly strange results, since it seems not to always use the standard defaults.

Hope I've cleared the water more than I've muddied it.
David

5620
Automation Interface, Add-Ins and Tools / Re: BPMN add-in
« on: March 25, 2006, 03:23:33 pm »
There's been some discussion in the forum about this. Try searching on BPEL.

I believe this is not available as a standard EA function at this time, but that Sparx is working on it for a (not too distant) future release. Some forum members have discussed creating add-ins (or scripts) to do this. Try replying to their posts directly and ask to be notified of replies.

5621
No ideas here either. Nor can I find anything in your code that looks wrong. I've programmed EA from a Word macro in VBA some time ago, and would have gone about this in pretty much the same way.

I have just worked through the same process via VB.Net (2003), which is why I had a code snippet earlier. Still, there does not seem to be much that is wrong with what you are doing.

For now I guess you are stuck with the current behavior. Still, I'm sure you should be able to do this. I am going to be delving into some relatively similar code over the next few days (including the weekend), and will fire off an update to this thread if I think of anything new.

David

5622
Two ideas:

Try calling ReloadProject. I think this is overkill, but it would be interesting to know if this solves the problem.

Try changing the appropriate line to:
Code: [Select]

DefCol = "14938876" ' (252 + 242 * 256 + 227 * 256 * 256)

I'm not sure if VBA will insert a space before or after it converts the numeral to a string, and formatting is very critical in the Style() string.

Please let me know if either work.I've just gone through something similar, but cannot (yet) see either the same issues in your code (which looks pretty good at first glance) or your situation. I'll write back if I catch on.

David

5623
This is a somewhat good news, somewhat bad news situation.

First the somewhat bad news:

To the best of my knowledge you will not get the 'near real time' behaviour you seek. EA can recognize and warn you, depending on various settings, that the background model has changed. However, (at least some) things that are happening in an open session of EA will not be updated in real time.

In particular, diagrams that are open on your desktop will not automatically update themselves. [I keep thinking there's a setting for this but cannot remember what it was; it was probably only a dream.] You can reload an individual diagram - just right click on the diagram tab (usually at the bottom of my screen, but configurable) and select the appropriate context menu entry. There does not seem to be an easy way to do this from the main menu. [Again, I may be missing something here, but I never seem to find it anywhere other than the context menu.]

Another area where you may experience problems is the project view tree. I have found that removing and replacing a package and its internal structure - which you might do with a working copy, or an internal reference model - can cause a 'phantom' entry in the tree. You might have two "Working" packages side by side, one is the 'real' one, and the other is the one you deleted. The tree will not update itself unless and until you reload the project.

Now the somewhat good news:

You can call Repository.ReloadDiagram(DiagramID) from the automation interface, this will clean things up in the instance of EA you are connected to. This works fine for an add-in, but does not solve the problem if you have EA open on your desktop and a concurrent connection to a (shared) model from an external automation client.

You can call Repository.RefreshModelView(PackageID) to refresh a package hierarchy in the tree (and perhaps more). This can also be called with a PackageID of 0, which will refresh the entire model.

You can call Project.ReloadProject() to reload the entire project. [Remember, you can obtain a refernce to the project interface via Repository.GetProjectInterface()] Once again, this affects only the instance of EA you are connected to via automation. If you have another session going from the desktop that session will continue to experience double vision until you manually reload.

Please let me know how you make out with this.

HTH,
David

5624
Hi again Malmoth,

Wonders never cease...

Since I wrote my earlier answer someone asked if I could highlight one element per diagram, and suggested a heavier border. I was successful, and did it as I had suggested.

Here's some brute force code (written in VB.Net 2003):
Code: [Select]
Dim eaDO As EA.DiagramObject
eaDO = DirectCast(eaDiag.DiagramObjects.AddNew("", "DiagramObject"), EA.DiagramObject)
eaDO.ElementID = elemId
eaDO.Style = "BCol=" & (Color.Beige.R + Color.Beige.G * 256 + Color.Beige.B * 256 * 256).ToString _
   & ";BFol=0;LCol=255;LWth=2;"
eaDO.Update()
I ended up with a beige background, black forground (i.e. the text), and a red border two pixels thick.

Remember the following:
  • Do not attempt to read the "current" Style() attribute and modify it; as the documentation says, this "will give undefined results" (darn!)
  • [AFAIK] You must[/] provide the entire string, in the format and order they define, for this to work. If EA cannot understand, or does not accept, all the values you provide, it will use the default values for all style attributes.

HTH,
David

5625
AFAIK you have to provide all the (pseudo)parameters in the .Style string, even if you are using the defaults or what's already there. Otherwise EA seems to ignore whatever you try to add.

Pages: 1 ... 373 374 [375] 376 377