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

Pages: [1]
1
Yep it works!

Thank you very much! ;D

2
Hello!

Is it possible to add lines to the Add-In-menu? (between the menu-items)

That would be great, because they can work as separators and you don't have to create those sub-menus.

So is there a way to do that?

3
That would be fine  ;)

Thanks for your replies!

4
Hello, me again...

I want to ask if it is possible to select an Element in the Diagram-view, and also the other way round, if it is possible to check if an Element is selected in the Diagram-view.

I tried different things, like checking the tagged values and the stereotypes but I don't get it.

Is it an property of Element or Diagramobjects or am I totally wrong and it is not possible to do that?

edit:

OK found out that it will work with Diagram.SelectedObjects, now I just have to find out how...

edit_2:

OK it's not working because Diagram.SelectedObjects is a read-only collection...

I can find out which Element is selected, but i can't add a new selected object with Diagram.SelectedObjects.AddNew("", "").

Is there an other way to select an Element in the Diagramview?

5
Automation Interface, Add-Ins and Tools / Re: bug in ObjectType?
« on: April 12, 2007, 01:37:33 am »
Nope....

Neither creating a new Model Node, nor applying the "model" stereotype will return otModel.

But I think that the stereotype will not change the value of GetTreeSelectedItemType, because I have many Elements with different stereotypes and it always returns otElement.

But it's not so important to find out now, your solution worked fine and so we don't have to hurry  ;)

6
Automation Interface, Add-Ins and Tools / Re: bug in ObjectType?
« on: April 11, 2007, 11:42:40 pm »
Yeah it's working that way, thanks.  ;)

But now there is the question for me, why doesn't it work with GetTreeSelectedItemType, or more precise, why does GetTreeSelectedItemType return otPackage instead of otModel?

Or the other way, in which situation will GetTreeSelectedItemType return otModel as a value?

7
Automation Interface, Add-Ins and Tools / bug in ObjectType?
« on: April 11, 2007, 06:37:19 am »
Hello!

I just figured out that Root-Models count as otPackage instead of otModel, by using GetTreeSelectedItemType.

Is this correct or is it a bug? ???

8
Hello!

I try to check if a package has an User Lock.

But I don't know which attribute of package it is (imho the user guide is not precise enough at this point)

I already tried:

package.IsProtected
package.IsControlled
package.IsVersionControlled

I tried to find out if a package is user locked with the following if-statements:

set o = app.repository.GetTreeSelectedObject

set p = app.repository.GetPackageByID (o.PackageID)

If p.IsProtected = True Then

   MsgBox "User Lock"

Else

   MsgBox "No User Lock"

End If

If p.IsControlled = True Then

   MsgBox "User Lock"

Else

   MsgBox "No User Lock"

End If

If p.IsVersionControlled = True Then

   MsgBox "User Lock"

Else

   MsgBox "No User Lock"

End If


I tried this with a package which has a User Lock and with a package which has no User Lock.
Both times I just got "No User Lock"-messages.

So how can I find out if a package has a User Lock or not?

I am running the new Build 805. Hope you can help  :-[

edit: I found out that it is working with elements.Locked, but not with packages and diagrams.

9
yeah it's working! ;D

Thank you very very much for your help @all!!! :)

10
OK I have run the integrity check and he found 5 connector problems. EA has cleaned it but the thing with the diagramlinks won't work.

I can change all values of the diagramlink and update it without problems, but if I change the connectorid value of the diagramlink, he skips the update and just breaks out of the procedure without a failure message.

I think i have to add a new diagram link for each connector I add to the diagram (and the graphical interface) but how can I do it?

There is no information in the user guide about adding diagramlinks and here in the forum there are no hints how to do it.

If I try diagram.diagramlinks.addnew() it says that the parameter is not optional. I have to give it a name and a type. A name would be no problem, but which type can i choose?

11
I am running build 803.

I am sorry but I don't know SQL... :-[

So is it possible to change the diagramlink values of a connector which has been created in that procedure?

I haven't been working with a t_diagramlinks entry yet, what is that exactly?

12
That was a hot hint!

I tried to change the path-value of the diagramlink of an other existing connector and it's working.

While trying to change the path-value of the diagramlink of the created connector, I realised that they don't have an own diagramlink  :-/

But I thought that the diagramlink is the graphical appearance on the screen, so they MUST have a diagramlink, or am I wrong? ???

I also tried to create new diagramlinks with d.diagramlinks.addnew() but I don't know what to put into the parameter (). And I haven't found anything in this forum about that.

I am clueless now :-[

edit: forgot to say, yes the connectors and the diagrams are updated everytime a change is done on them.

13
you are right, it's not neccessary to change the diagramid, because it isn't changing (diagramid = 491 the whole time) but even if i comment those lines out, it stops at the line where the program should do the update  :-/

14
The values are all correct, I checked them with msgboxes (but deleted them in my code above)

There is more code in my program (330 lines) but I am just posting the code for overwriting the diagramlinks, because the rest works very well.

i have two funktions, one for selecting a component and writing all values in arrays and one for overwriting the second component.

Here is the code of the first function, for writing the values into the arrays.

The values are assigned as following:

Set d = Repository.GetDiagramByID(id_dia2)

i = 0

For Each dl In d.DiagramLinks

  For k = 0 To d.DiagramLinks.Count - 1

     If dl.ConnectorID = id_con(k) Then

        path_dl(i) = dl.Path
        geometry_dl(i) = dl.Geometry
        diagram_dl(i) = dl.DiagramID
        connector_dl(i) = dl.ConnectorID

     End If

  Next

  i = i + 1

Next


i hope this helps  :-[

15
Hello!

I am trying to combine two components into one.

Therefore I want to overwrite the values of all diagramlinks which are connected to the first component with the values of the second component.

But after changing the values and calling the dl.update function, the program just stops.

The script runs through the for-loop and calls the dl.update function without problems but after accessing the if function the dl.update function is not called and the program stops.

does anyone know how to solve that problem? ???

Set d = Repository.GetDiagramByID(id_dia2)

i = 0

For Each dl In d.DiagramLinks

  For k = 0 To d.DiagramLinks.Count - 1

     If dl.ConnectorID = connector_dl(k) Then

        dl.Path = path_dl(i)
        dl.Geometry = geometry_dl(i)
        dl.ConnectorID = id2_con(i)
        dl.DiagramID = diagram_dl(i)

        dl.Update

        Repository.ReloadDiagram (id_dia2)

     End If

  Next

  i = i + 1

Next

Pages: [1]