Book a Demo

Author Topic: Modify the Default Appearance of EA objects  (Read 4463 times)

mv01d

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Modify the Default Appearance of EA objects
« on: January 08, 2014, 01:43:30 am »
How do I modify the default appearance of a specific object via the object model. As far as i can see. the object properties are stored in the t_object tabel (e.g t_object.Backcolor).

Thanks for your help!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Modify the Default Appearance of EA objects
« Reply #1 on: January 08, 2014, 08:44:12 am »
For unknown reasons the API has a number of limitations. You can modify t_object columns via Repository.Execute ("UPDATE t_object..."):



From my Inside book.

q.

mv01d

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Modify the Default Appearance of EA objects
« Reply #2 on: January 08, 2014, 09:27:47 pm »
Tanks for your advice! I'm using Enterprise Architect 10. I just checked the EA.Repository object for a possibility but there is only a SQLQuery method which fails on update statements like UPDATE t_object SET Backcolor=-1 WHERE Object_ID=3 with:

DAO.QueryDef [3141]

The SELECT statement incluides a reserved word or anm argument name that is misspelled or missing, or the punctuation is incorrect.



qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Modify the Default Appearance of EA objects
« Reply #3 on: January 08, 2014, 10:13:31 pm »
As said: use Repository.Execute, not SQLquery.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Modify the Default Appearance of EA objects
« Reply #4 on: January 08, 2014, 10:52:04 pm »
Quote
As said: use Repository.Execute, not SQLquery.

q.
Execute is a hidden, non documented operation, but it does exist and works just fine.

Geert

mv01d

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Modify the Default Appearance of EA objects
« Reply #5 on: January 09, 2014, 02:45:25 am »
Ok, you are right. Execute is one of the [TypeLibFunc(64)] marked methods from the IDualRepository.

Thanks!

mv01d

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Modify the Default Appearance of EA objects
« Reply #6 on: January 16, 2014, 05:56:00 pm »
REMARK:

Indeed there is a method for altering the default appearance of EA objects:

SetAppearance (long Scope, long Item,  long Value)

http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/element2.html