Book a Demo

Author Topic: Property Type via Script  (Read 2392 times)

EAButNotForGames

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
Property Type via Script
« on: May 05, 2026, 05:18:12 pm »
Does anybody know if it is possible to fill the Type field of a property element in its Property Tab via a script.
I can read it through PropertyTypeName, but I can't find a way to edit it.
I want to automatically generate Properties via a Script and define their Type (and maybe even the Initial Value) on specific conditions.

I can't even find that Type field of that property in the sql tables.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13514
  • Karma: +573/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Property Type via Script
« Reply #1 on: May 05, 2026, 06:58:32 pm »
It is definitely possible.

The easiest way to find out what is happening exactly, is to check what EA sends to the database.

If you have an MS SQL Server, you can use SQL Profiler. Other databases likely have a similar tool.

In case you don't have a tool like that, I would start comparing before and after a change, and see what happens.
I'm pretty sure it will either be in t_object, t_xref or maybe t_objectproperties(tagged values).
Once you know where it is stored in the database, it's usually pretty easy to figure out what field in the API you need.

Geert

EAButNotForGames

  • EA User
  • **
  • Posts: 47
  • Karma: +0/-0
    • View Profile
Re: Property Type via Script
« Reply #2 on: May 12, 2026, 08:21:41 pm »
I figured it out. But weirdly I can't give it one of the types, that are shown in the drop-down menu of the type field in the property tab.
You have to set an existing element as the type.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13514
  • Karma: +573/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Property Type via Script
« Reply #3 on: May 12, 2026, 08:40:07 pm »
Not sure if this applies to your case as well, but for attributes there are actually two field.
One field
t_Attribute.Type is the name of the type
t_Attribute.Classifier is the ID of the datatype for this attribute.

The standard dropdown (int, string, boolean) only sets the type field. If you use Select Type, the Classifier will be filled in (as well as the type field)

Geert