Book a Demo

Author Topic: Attribute values  (Read 4198 times)

Alika87

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Attribute values
« on: June 27, 2013, 06:25:57 pm »
Hi Guys,

I have a model with a buch of packages and diagramms. Now i want to write a little AddIn in C# to save the Proporties of a class or package in a CSV-File.
My problem now is, that i get the names of attributes but cannot access to the defined attribute-values.

Code: [Select]
tagString2 = tagString2 + theAttributes.Name.ToString() +
"=" + theAttributes.//here i need a
function that gives me the value of that attribute//.ToString();

The little codepart looks like that. Do anybody can give me a little clue?
« Last Edit: June 27, 2013, 06:27:12 pm by Alika87 »

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Attribute values
« Reply #1 on: June 27, 2013, 07:28:42 pm »
Hi,

you want the value of an Attribute?

An Attribut has a buch of properties/attributes but no property value. The possible properties are described in the help (Automation and Scripting, Reference, Element Feature Package, Attribut Class).

Valuable information you can also find in Thomas Kilians book ScriptingEA.

Best regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Attribute values
« Reply #2 on: June 27, 2013, 07:32:39 pm »
In case mean the Intitial Value, you can use Attribute.Default

Geert

Alika87

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Attribute values
« Reply #3 on: June 27, 2013, 07:50:38 pm »
Quote
Hi,

you want the value of an Attribute?

An Attribut has a buch of properties/attributes but no property value. The possible properties are described in the help (Automation and Scripting, Reference, Element Feature Package, Attribut Class).

Valuable information you can also find in Thomas Kilians book ScriptingEA.

Best regards,

Helmut

sorry, of course i meant the initial value of a particular attribute. Thank you Geert for your suggestion, i will try it right away.

edit: it works, thank you again :)
« Last Edit: June 27, 2013, 07:53:44 pm by Alika87 »