Book a Demo

Author Topic: Change element's appearance background color  (Read 8619 times)

gandel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Change element's appearance background color
« on: February 26, 2014, 09:32:05 pm »
Hi,
I want to change background color of an element (class or use case) to a given RGB color. How can I make this (with script)?

Thank you in advance

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Change element's appearance background color
« Reply #1 on: February 26, 2014, 10:58:45 pm »
Check Element.Setappearance in the help.

q.

gandel

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Change element's appearance background color
« Reply #2 on: February 26, 2014, 11:16:32 pm »
Thanks, it works:
Code: [Select]
myElement.SetAppearance(1,0,color);//color is RGB number
myElement.Update();

2pointO

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Change element's appearance background color
« Reply #3 on: February 04, 2016, 07:33:44 pm »
Hi,

I also want to set the appearance of an element via a VBA Script which automatically creates component out of an excel sheet I used :
Code: [Select]
myElement.SetAppearance(1,0,255)
myElement.Update
parentPackage.elements.Refresh
 
and when I try to run the script I get the error : Error while compiling , syntax error , expected =    (translated)
VBA doens't need the ; at the end , I have mutliple methodes in that script that work fine with the syntax but here it asked me to set a "=" for what?

Thank you

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Change element's appearance background color
« Reply #4 on: February 04, 2016, 07:47:51 pm »
try
Code: [Select]
myElement.SetAppearance 1,0,255
Geert

2pointO

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Change element's appearance background color
« Reply #5 on: February 04, 2016, 08:18:41 pm »
Works, thank you :)

Sarah