Book a Demo

Author Topic: Trying to set Integer or Real as PropertyType  (Read 7469 times)

JoostN

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Trying to set Integer or Real as PropertyType
« on: August 20, 2021, 11:49:18 pm »
Hello,

I try to set the PropertyType of a new Part to Real or Integer, something I can do in the GUI using the dropdown for "Type", which contains Boolean, Integer, Real, ...
I assume that PropertyType for an element expect an ID, but I don't know how to find such ID for these primitive types.

Any idea? Thanks!


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Trying to set Integer or Real as PropertyType
« Reply #1 on: August 21, 2021, 02:37:14 am »
There is no ID for primitive types. They only have a name.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Trying to set Integer or Real as PropertyType
« Reply #2 on: August 21, 2021, 06:07:23 am »
The do have some special GUID IIRC....

q.

JoostN

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Trying to set Integer or Real as PropertyType
« Reply #3 on: August 23, 2021, 09:45:23 pm »
There is no ID for primitive types. They only have a name.
Since the PropertyTypeName is readonly, is there any other way to assign Real or Integer then?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Trying to set Integer or Real as PropertyType
« Reply #4 on: August 23, 2021, 11:02:23 pm »
They are coded as special GUIDs in t_object.pdata1 (equals MiscData[0]). Taken from my Inside book p. 9 the can be one of

Quote
{EABOOL00-B653-4f3c-A010-30205D67F5F5}
{EAINT000-B653-4f3c-A010-30205D67F5F5}
{EAREAL00-4339-434b-BC17-A5E1FDC63F6C}
{EASTRING-B653-4f3c-A010-30205D67F5F5}
{EAUNAT00-B653-4f3c-A010-30205D67F5F5}

And now guess...

q.

JoostN

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Re: Trying to set Integer or Real as PropertyType
« Reply #5 on: August 30, 2021, 06:51:55 pm »
Perfect, setting PDATA1 to the correct GUID did the job!
Thanks a lot!
Joost