Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: blawton on January 07, 2011, 02:27:22 am

Title: [solved] Display an Element's Notes via Addin Code
Post by: blawton 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!
Title: Re: Display an Element's Notes via Addin Code
Post by: blawton 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
Title: Re: Display an Element's Notes via Addin Code
Post by: KP 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();
Title: Re: Display an Element's Notes via Addin Code
Post by: blawton 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?