Book a Demo

Author Topic: Problem adding a SysML (v1.5) Block Diagram results in creating a UML Class Diag  (Read 2061 times)

rchalleray

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Good morning

I want to create a diagram which is a SysML Block diagram.

I used the following code (based on the information that is out there in the web):

  var XSD_DM_Diagram as EA.Diagram;
XSD_DM_Diagram = root_IE.Diagrams.AddNew(root_IE.Name, "SysML1.5::Block");
XSD_DM_Diagram.Notes = "Test diagram created by the ManageDiagramsExample script";
XSD_DM_Diagram.Update();

The problem is that EA is always simply creating a "UML class diagram" for me instead of the SysML block diagram (which is the intention).

Can you clarify why this is? What error am I doing wrong? What parameters should I pass to the  root_IE.Diagrams.AddNew so that it will create a SysML Block diagram instead of the default UML class diagram?

I shall be most grateful for your clarification.

Program Version: 16.0.1604 (Build: 1604) - 32 bit [Version that is being used by me]

Can someone please provide a clarification and direct me to additional scripts (concerning how Javascript can be used to automate diagram creation). I am looking for more scripts in addition to the example scripts already provided by EA in the script library.

Best regards
Rob

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8087
  • Karma: +118/-20
    • View Profile
You need "SysML1.4::BlockDefinition".

Try retrieving diagram.MetaType from an existing block diagram instead (or whichever diagram type you want to create in the future)

SysML 1.5 is only an alias on the SysML1.4 profile. EA does not allow querying on the alias, while there just isn't a definition in the diagram profile for "Block".

rchalleray

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Hi Eve

Thank you for your brilliant clarification.

May I wish you a brilliant day! Thanks a million!

Best regards
Rob