Book a Demo

Author Topic: Equivalent to the 'Change Type' in EA scripting?  (Read 3783 times)

LFritzke

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Equivalent to the 'Change Type' in EA scripting?
« on: June 14, 2018, 03:18:11 am »
I have been working on moving MagicDraw (MD) models to EA, but 'Requirements' imported from MD show up as 'Classes' in EA. I want to change these Classes into Requirements through a script in stead of using 'Change Type' on requirements individually.

My idea was to change the MetaType, since neither Type nor Stereotype can change the element like 'Change Type' does, however MetaType is Read Only for Elements (but not Diagrams). So how do I change it? Or is there a better way to do requirements in MD so that I don't have to worry about this at all?

I was reading some posts back from 2011 about this exact topic, but MetaType was Read/Write back then.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Equivalent to the 'Change Type' in EA scripting?
« Reply #1 on: June 14, 2018, 04:43:12 am »
It's EA.Element.Type you are looking for.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Equivalent to the 'Change Type' in EA scripting?
« Reply #2 on: June 14, 2018, 04:49:35 am »
And EAElement.Stereotype holds Functional, etc. (what's in the Req.s drop down type).

q.

LFritzke

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Equivalent to the 'Change Type' in EA scripting?
« Reply #3 on: June 14, 2018, 05:43:38 am »
That worked. I guess when I was changing the Type before I wasn't refreshing the diagram.

Thanks a lot