Book a Demo

Author Topic: Set Element's Default Name  (Read 6168 times)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Set Element's Default Name
« on: April 22, 2015, 10:08:19 pm »
When a package is dragged on a diagram, its default name is "package" + number.

I would like dragged packages to be auto-named "directory".
How?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Set Element's Default Name
« Reply #1 on: April 22, 2015, 10:22:38 pm »
Can't do. Auto-counter needs a number (hence the name). You could do what you want by using an add-in listening to the EA_OnPost... events.

q.

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: Set Element's Default Name
« Reply #2 on: April 23, 2015, 10:01:43 am »
Quote
When a package is dragged on a diagram, its default name is "package" + number.

I would like dragged packages to be auto-named "directory".
How?

While configuring Auto names:
  • Prefix=Directory
  • Counter=1
  • check the option "Apply on creation"
http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/modeling_basics/autocounternames.html

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Set Element's Default Name
« Reply #3 on: April 23, 2015, 02:44:54 pm »
That will append a number. Tehila1 wants it without a number.

q.
« Last Edit: April 23, 2015, 04:05:28 pm by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Set Element's Default Name
« Reply #4 on: April 23, 2015, 03:44:37 pm »
Quote
When a package is dragged on a diagram, its default name is "package" + number.

I would like dragged packages to be auto-named "directory".
How?
Could you explain the use case?
I really don't see why anyone would want a feature like that.

In any way, you will need to use the EA_OnPostNewPackage event. You can either write an add-in, or use EA-Matic and write a script to rename the new Package

Geert

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Set Element's Default Name
« Reply #5 on: April 26, 2015, 05:45:11 pm »
Quote
Quote
When a package is dragged on a diagram, its default name is "package" + number.

I would like dragged packages to be auto-named "directory".
How?

While configuring Auto names:
  • Prefix=Directory
  • Counter=1
  • check the option "Apply on creation"
http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/modeling_basics/autocounternames.html


Thanks. This is what I was looking for. 2 questions please:

1. Is it possible to export the Auto-Naming definitions to other model?
2. How can I set auto name to elements that do not appear in the drop-down list? Is there a way to set it via EA installation directory or registry?

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: Set Element's Default Name
« Reply #6 on: April 27, 2015, 10:03:01 am »
Quote
Quote
Quote
When a package is dragged on a diagram, its default name is "package" + number.

I would like dragged packages to be auto-named "directory".
How?

While configuring Auto names:
  • Prefix=Directory
  • Counter=1
  • check the option "Apply on creation"
http://www.sparxsystems.com/enterprise_architect_user_guide/12.0/modeling_basics/autocounternames.html


Thanks. This is what I was looking for. 2 questions please:

1. Is it possible to export the Auto-Naming definitions to other model?
2. How can I set auto name to elements that do not appear in the drop-down list? Is there a way to set it via EA installation directory or registry?

1. No. But, you may help yourself, see t_trxtypes table
2. I don't think so.

You may want to send a feature request.