Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Matt on December 21, 2003, 09:11:06 am
-
Hi there,
it may be a silly question but...
what is the Item that I need to pass into this function?
Surely it should be a straight call - GetTreeSelectedItem() as ObjectType.
Please can someone advise on what I should pass to the function as the documentation is not clear on this.
Very many thanks,
Matt
-
Think i have worked this out. This code seems to work anyway. The actual selected object is a in-out parameter, not the return value. The return value is the selected object's type, which you can test and set the object to an appropriate typed variable, should you require.
Someone can correct me if i am wrong.
Public Sub Addin_MenuClick(Repository As EA.Repository, ByVal MenuName As String, ByVal ItemName As String)
Dim selectedObject As Object
Dim selectedObjectType As EA.ObjectType
If (ItemName = COMP_DETAILS_COMMAND) Then
selectedObjectType = Repository.GetTreeSelectedItem(selectedObject)
MsgBox selectedObject.Name