Book a Demo

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

Pages: [1] 2 3
1
General Board / Change names of foreign keys in a class diagram?
« on: March 31, 2011, 09:48:28 pm »
Hello,

I used EA to create an ER diagram of some of my columns (in the database). So far, this worked fine.

Unfortunately, I`ve noticed that the foreign keys are displayed with an internal string (I guess) and not the name of the referenced table itself.

Example:
Table A references table B.

After creating the ER diagram with EA, there are the classes A and B, while there is a connector pointing from A to B.
This is fine.

But in Class A, the operation (=the foreign key) is displayed with "SYS_COO51515(Number)" instead of "B(Number)".

Is there any way to get this done with EA?

I think that I could write a short JScript or something that would accomplish this task.
It would be nicer if EA had a function for this  ;)


Best regards,
palim

2
General Board / How to insert a consecutive number into table?
« on: September 15, 2010, 09:12:50 pm »
Hello,

is it possible to insert a consecutive number into a table for the RTF-Export?

I would like to have a table like the following:

1     Hello
2     Sparx
3     World

Of course, the numbers should be created (incremented) automatically.

Any ideas how to do this in a template?


Best regards,
palim

3
General Board / Re: How to determine a subpackage programmatically
« on: April 08, 2010, 04:26:55 pm »
Quote
Palim,

The API isn't equipped with the Do what I meantm module yet.
So until that is implemented I'm afraid you'll have to RTFM.
I don't think "ID" is a column in the t_package table, and as Simon pointed out, passing an xml string to an operation that requires an integer isn't going to work out very well either.
Geert

Well, I admit that I blindly used the two functions you mentioned in your previous post. And yes, that might lead to the conclusion of the Do what I meantm module.

Regarding the documentation:
I`m generally missing way more tutorials.
I`m pretty new to Enterprise Architect, but to me the API leaves more questions than answers.

Regarding my problem:
I guess it will be less effort to iterate recursively over a model and determine a package.


Best regards,
palim


4
General Board / Re: How to determine a subpackage programmatically
« on: April 08, 2010, 12:54:40 am »
Quote
Quote
Palim,

You can either recurse through the packages using Package.Packages, or you can use an SQL Query to find the package with the given name.
I would choose for the last option. (since that is a lot faster)

use Repository.SQLquery to get the id of the package, and then Repository.GetPackageByID to get the package.

Geert


Hello,

I`ve tried it, but unfortunately, I´m not getting it done.

First of all:
What does the SQL command have to look like?
I tried it with "select ID from t_package where name = 'acme'"
Is it correct?

Next, I wanted to test it in a VBScript in EA before implementing it into my Excel macro.
For that, I used the following code:
Code: [Select]
dim repository as EA.Repository
dim package as EA.Package
dim id

id = repository.GetPackageByID(EA.Repository.SQLQuery("select ID from t_package where name = 'acme'"))
When getting to the last line, I`m getting a 'The variable is not defined' error.
But defining the variable 'id' as integer doesn`t work either.

Do you know a possible solution?


Best regards,
palim

5
General Board / Re: How to determine a subpackage programmatically
« on: April 02, 2010, 12:54:29 am »
Quote
Palim,

You can either recurse through the packages using Package.Packages, or you can use an SQL Query to find the package with the given name.
I would choose for the last option. (since that is a lot faster)

use Repository.SQLquery to get the id of the package, and then Repository.GetPackageByID to get the package.

Geert

Okay, I`ll try it.
Thank you.

6
General Board / How to determine a subpackage programmatically?
« on: April 01, 2010, 11:15:05 pm »
Hello guys,

I`m having a problem determining a subpackage of a model (with a JScript)

Here`s my example:

MyModel
  UpperPackage A
       SubPackage B
            SubSubPackage C

I want to get 'SubSubPackageC' with a JScript, how can I do this?

This far, I have the following:

Code: [Select]
var theModel as EA.Package;
theModel = Repository.Models.GetByName("MyModel");                     var anforderungPackage as EA.Package;
anforderungPackage = theModel.Packages.GetByName("SubSubPackage C");      


Well, when getting to the last line, I receive an 'IndexOutOfBounds' error.

Hope you can help me.


Best regards,
palim

7
General Board / Re: RTF reports - how to change the style?
« on: April 06, 2010, 11:01:50 pm »
Hi guys,

I`ve solved the problem.


Best regards,
palim

8
General Board / RTF reports - how to change the style?
« on: April 06, 2010, 09:40:43 pm »
Hello guys,

I`m trying to create a generated RTF document. This works so far.
Now, I want to change the style of a document, i.e. change the color of a heading.

My problem is that I don`t know where to do this.
I`ve used the 'Help' function of EA and it directed me to change the file 'normal.dot'. I openend this file, but there is no content in it.
I thought that this would be the default style, but why is there no content?
Also, it seems like changing the 'normal.dot' changes the style for every project. I just want to have it for a specific one.

Next, I tried to create a new template - 'Resources -> Legacy template'.
In there, you can select some sections (like 'Heading 1').
When clicking on this, some text is shown in the right window.
Still, I don`t know where and how to change the color, insert bold text and so on.

Hope you can help me.


Best regards,
palim

9
General Board / RTF screen - change image automatically?
« on: March 27, 2010, 01:16:39 am »
Hello guys,

I`m inserting a screen object onto a diagram as a simple link.
After that, I go to 'Appearance - Select Alternate Image' and insert a new image from my hard disk.

I`m wondering if it`s possible to have this picture automatically refreshed. I know that there`s a menu point called 'Update Selected...'.
When clicking this, I`m able to select another picture.

But I want something like the following:
Picture A is at 'c:\document and settings\pictureA'.
I`m inserting this picture into a screen object.
Now, I`m replacing 'Picture A' with another file (on the hard disk), but the filename (of the new file) still is 'pictureA'.
And now, it would be great if EA could refresh the screen object with the contained picture.

Is this possible?


Best regards,
palim

10
General Board / Re: How to use a tagged value with type memo?
« on: March 13, 2010, 12:02:40 am »
Geert,

thanks for your hint.
I`ve solved the problem.

For anyone interested, here`s my code snippet:

      Dim newTag1 As EA.TaggedValue
      Set newTag1 = tags.AddNew(tagName, "<memo>")
      newTag1.Update
      newTag1.Notes = tagValue
      newTag1.Update


As Geert said, it`s important to set "<memo>" as the tag`s value and then set the tag`s notes with:
newTag1.Notes = "content of this note"  
(replace "content of this note" with your text ;-) )


Best regards,
palim


Quote
Yes, and use "<memo>" as tagvalue

Geert

11
General Board / Re: How to use a tagged value with type memo?
« on: March 12, 2010, 10:59:22 pm »
Geert,

unfortunately, I don`t know how to use your answer.
I tried to set "<memo>" into a tag value where the type is "String" (the default type).
I noticed the "..." and it behaves as if you set the type for this tagged value to "memo".

So far, so good.
But, how do I have to adjust my vba script?
I still don`t know how to store content into such a tagged value.

Do I have to use something like this:

    Dim newTag As EA.TaggedValue
    Set newTag = tags.AddNew(tagName, tagValue)
          newTag.Notes = "My content ..."


Best regards,
palim

12
General Board / How to use a tagged value with type memo?
« on: March 12, 2010, 08:49:12 pm »
Hello guys,

I`ve recently added some tagged values into an EA element programmatically (VB).
This works fine, but a tagged value`s value field is limited to 256 characters. Now I`ve learned that you might be able to use a tagged value of type 'memo'.
To do this, I created a structured tag value and used the type 'memo' (in EA: Settings -> UML -> Tagged Value Type).

My problem is that I don`t how to access this tagged value programmatically.

I tried this (ain`t working):

    Dim tags As EA.Collection
    Set tags = parentClass.TaggedValues
        
    Dim newTag As EA.TaggedValue
    Set newTag = tags.AddNew(tagName, tagValue)
    
    newTag.Update
    tags.Refresh


When the function containing this code is called, VB show an error message that the saved value is to high. That means that I`m trying to store more than 256 characters into the tagged value.

I also tried this (short version:

Set newTag = tags.GetElementByName("Memo-Tag")
newTag.Value = "content"


This didn`t work either.


Does anybody know how to access a 'memo' tagged value?


Best regards,
palim

13
General Board / Re: How to group elements in the Project Browser?
« on: March 05, 2010, 01:12:51 am »
Hello KP and Aaron B,

it`s working.
Thank you very much :-)


Best regards,
palim

14
General Board / How to group elements in the Project Browser?
« on: March 04, 2010, 02:47:39 am »
Hello guys,

I`m importing requirements via a MS-Excel macro into EA.
Momentarily, every element is being imported into one package.

However, I`ve seen that elements can be grouped under an element.

Example:
There is an element "req1 - parent".
Also, there are elements named "req1 - sibling A", "req1- sibling B", and so forth.
On the Project Browser, it is possible to select "req1 - sibling A", "req1 - sibling B" and draw it under "req1- parent".
After that, the "plus" icon appears.

Is there any way to do this programmatically?

I checked the element`s reference and there is a method called "IsLeaf()". Can this be used for that?
Does anybody have a small code snippet?

Best regards,
palim

15
General Board / Re: Collection - similar to a Java map?
« on: March 03, 2010, 10:53:57 pm »
Hi Geert,

yes, I`m talking about EA.Collection.
Can it be used as a Java map?

Quote
Palim,

Which collection are you talking about? The EA.Collection?

Geert

Pages: [1] 2 3