Author Topic: [solved] Display an Element's Notes via Addin Code  (Read 4161 times)

blawton

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
[solved] Display an Element's Notes via Addin Code
« on: January 07, 2011, 02:27:22 am »
I'm sure this is simple and something I've overlooked, but I'm making a C# addin to generate diagrams and I'd like each element to display its notes by default -- is this something to do with an element's Style/StyleEx? I know how to display the notes from the GUI once the diagram is generated, but I'd rather have the notes field displayed automatically upon the diagram's generation. Thanks for your help!
« Last Edit: January 18, 2011, 09:29:01 am by blawton »

blawton

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Display an Element's Notes via Addin Code
« Reply #1 on: January 07, 2011, 03:59:33 am »
Nevermind, I found it in the user manual:

Code: [Select]
diagram.StyleEx = "ShowNotes=1";
diagram.Update();

http://www.sparxsystems.com/enterprise_architect_user_guide/8.0/modeling_languages/attribute_values___stylex__pda.html

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Display an Element's Notes via Addin Code
« Reply #2 on: January 07, 2011, 08:34:59 am »
I think you've missed a semi-colon...

Quote
diagram.StyleEx = "ShowNotes=1[highlight];[/highlight]";
diagram.Update();
The Sparx Team
[email protected]

blawton

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: Display an Element's Notes via Addin Code
« Reply #3 on: January 07, 2011, 09:49:32 am »
Quote
I think you've missed a semi-colon...

Quote
diagram.StyleEx = "ShowNotes=1[highlight];[/highlight]";
diagram.Update();

it seems to work both ways -- could anything terrible happen if I forget to close the last styling option?