title: Enterprise Architect: Change diagram type (MetaType) by script
body: <p>i have to change the diagram type of a lot of diagrams within my Enterprise Architect model. The change can be made manually using following option (that works as expected):</p>
  
  <p>Select diagram - Diagram - Advanced - Change Type...</p>
  
  <p>As I have to change a lot of diagrams I have created a script which searches for all concerned diagrams and change the type automatically. I wrote already a lot of JScript EA scripts for changing some modeling elements. Unfortunately, this feature seems not be available over the scripting interface.</p>
  
  <p>I have to change the "MetaType" of the the diagram object. But this is read-only (see <a href="http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/diagram2.html" rel="nofollow">http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/diagram2.html</a>). Therefore, I got an error.</p>
  
  <pre><code>var currentDiagram as EA.Diagram
  currentDiagram = theDiagram
  currentDiagram.MetaType = MY_DIAGRAM_METATYPE // ERROR
  </code></pre>
  
  <p>In the next step I searched for appropriate functionalities in the Repository interface (<a href="http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/repository3.html" rel="nofollow">http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/repository3.html</a>) and in the project interface. But I found nothing appropiate.</p>
  
  <p>I am using Enterprise Architect 12.0.1215 and I used JScript.</p>
  
  <p>Has anyone already tried this by script?
  Have I missed something?
  Is there another approach to achieve the diagram type change by script?</p>
  
  <p>Thanks in advance!</p>