Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Tafros on January 07, 2019, 10:37:32 pm

Title: Unknown/Illegal Base Type" warning
Post by: Tafros on January 07, 2019, 10:37:32 pm
Hi
Am creating a custom tab through add-in using EA_OnContextItemChanged event and it works good as expected .
But  when i try to add a new diagram object from tool box EA throws a warning as "Unknown/Illegal Base Type" . Is this a known issue?
Below is the code snippet used in  EA_OnContextItemChanged  method.

  public void EA_OnContextItemChanged(EA.Repository Repository, string GUID, EA.ObjectType ot)
        {
            try
            {
                EA.Element ele = Repository.GetElementByGuid(GUID);
                if (ele != null)
                {
                    UserControl1 UC = Repository.AddTab("Try", "Test.UserControl1") as UserControl1;
                }
            }
            catch (Exception ex)
            {
            }
        }

Thanks
Title: Re: Unknown/Illegal Base Type" warning
Post by: Geert Bellekens on January 07, 2019, 11:42:05 pm
When exactly are you getting an error?
Are you sure the error is related to the code you mentioned?

Geert
Title: Re: Unknown/Illegal Base Type" warning
Post by: Tafros on January 08, 2019, 12:36:25 am
Hi Geert
Thanks for your response.
Actually my aim was to creating a custom tab on each object selection based on some conditions.
when i selecting an object from project browser or creating object using quick options from project browser,it working good as expected.

But When i trying to create an object on diagram workspace using toolbox/rightclick diagram workspace option, "EA_OnContextItemChanged" triggered,new tab will get created and at the end of this method it throws an Unknown/illegal base type 'Class'(Any UML Type) warning.

Thanks
Title: Re: Unknown/Illegal Base Type" warning
Post by: Geert Bellekens on January 08, 2019, 01:29:03 am
That's weird. I would expect such an error if you would have a bad MDG defining stereotypes that extend non-existing metaclasses.
Does it happen with any toolbox item?

Geert
Title: Re: Unknown/Illegal Base Type" warning
Post by: Tafros on January 08, 2019, 04:03:21 pm
This is happening only for UML types(Class,Use Case,Component,Device,Requirement,etc,.) toolboxes (Class,Use Case,Object,Component,Interaction,etc,.) but this is working good for MDG's like BPMN,Archimate and any custom MDG defined Stereotypes.
Title: Re: Unknown/Illegal Base Type" warning
Post by: Geert Bellekens on January 08, 2019, 06:14:56 pm
I would report a bug to Sparx and see what they have to say.

Geert
Title: Re: Unknown/Illegal Base Type" warning
Post by: TonyC on February 01, 2022, 03:25:13 am
Hi Tafros, I have the same error to the one that you have reported. I cannot add Classes to Class diagrams anymore, even as administrator. I can however add elements to state machines for example. My MDG technology extends the Class metaclass and the Table metaclass. I've removed my MDG technology temporarily but the issue still prevails. It is like the Class class has got corrupted in some way by my MDG technology. Did you get a response from Sparx on this?
Title: Re: Unknown/Illegal Base Type" warning
Post by: Helmut Ortmann on February 17, 2022, 01:39:54 am
Hi,

any news?

I get a similare error. But after EA_OnPreNewElement().

Best regards,

Helmut
Title: Re: Unknown/Illegal Base Type" warning
Post by: TonyC on February 17, 2022, 02:00:15 am
I solved it, but in a slightly strange way.

I logged on as Administrator. Disabled security (which took 20 mins!) then re-enabled it, making sure both processes completely successfully. I think that I lost connection to my server repository part way through the process of locking a large number of elements, which caused the corruption, so had to ensure I went completely round the loop again to remove the inconsistency. I can now create classes again! :)