Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: sravang on February 05, 2021, 06:03:03 pm

Title: How to get Classifier ID/GUID for item of type 'PART'
Post by: sravang on February 05, 2021, 06:03:03 pm
Hello,

I want either ID/GUID of the classifier of element of type 'PART' to process them under associations.
I know that in case of sql query the GUID can be retrieved from 'PDATA1' column of t_object table. But I want that ID through API. I tried element.ClassifierID but it returns 0.

Thanks,
Sravan
Title: Re: How to get Classifier ID/GUID for item of type 'PART'
Post by: Geert Bellekens on February 05, 2021, 06:58:37 pm
PData corresponds to Element.MiscData

Geert
Title: Re: How to get Classifier ID/GUID for item of type 'PART'
Post by: qwerty on February 05, 2021, 07:04:35 pm
I got the right value from ClassifierID. Looked at an Object being classified. But indeed, a Part returns 0. Will have to look...

q.
Title: Re: How to get Classifier ID/GUID for item of type 'PART'
Post by: qwerty on February 05, 2021, 07:09:02 pm
Indeed MiscData(0) contains the GUID of the classifier. EA strikes again!

q.
Title: Re: How to get Classifier ID/GUID for item of type 'PART'
Post by: Takeshi K on February 05, 2021, 08:03:33 pm
Please try Element.PropertyType.

HTH,
Title: Re: How to get Classifier ID/GUID for item of type 'PART'
Post by: sravang on February 05, 2021, 08:20:00 pm
Element.MiscData worked.

Thanks Geert,q for your response.

Thanks,
Sravan
Title: Re: How to get Classifier ID/GUID for item of type 'PART'
Post by: qwerty on February 05, 2021, 09:52:18 pm
Please try Element.PropertyType.

HTH,
That returns the ID. Funny though, it's not called PropertyTypeID. Ah, forgot, it's EA.

q.