Book a Demo

Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
What that means is that the parameter is passed by reference [...]
Use TabName.val and DiagramID.val.

The information about passing simple/primitive value parameter as 'boxed' (Javascript [object]) is worth to be included on the doc page, as it is unexpected here.
A know that *.val style of passing simple value parameter is used in scripting EA API as a 'workaround' for some model-addin methods, having [out] kind of parameters (i.e. parameter value being _returned_ from a method). But EA_OnTabChanged is not the case, so boxing a [in] string parameter is misleading and should be described explicitly (if left as-is for backward compatibility reason).
42
Hi Viking,

Thank you for your comment.

- Notation and size in diagrams

Currently, it is not easy to offer the 'tools' (MCP methods) for them, but I have added a feature to support the Template Package in Enterprise Architect.
Could you update the MCP addin to the latest (version 2.1.0) and then create a Template Package in your model, and then add a Archimate Compornent with your faviorite style?

- Adding attributes

Currently the MCP addin does not offer a tool to add attributes. I will add the feature in the future.

- cardinalities

On the version 2.1.0, we can modify the Multiplicities of connectors. Does this solve your situation?
43
General Board / Scripts and Custom Tables - How to Edit and Run
« Last post by ZuluTen on November 07, 2025, 01:33:30 am »
I am completely confused by the use of a script with a Custom Table, and wonder whether someone might please explain:

I have added a CustomTable to a diagram.

I can then, as per the manual, press Ctrl-Alt-7 whereupon a ‘child’ element titled “script()” appears in the Project Browser under the CustomTable. I can drop in some JavaScript, and save it.

Then following the manual (yes, foolish I know), I close the script editing tab, and revert to the diagram upon which the Custom Table is shown.

The manual actually says "If an associated script has been defined for the table, it can be run by right-clicking the table while it is not in edit mode then choosing the option 'Run Custom Table Script'." but I can see no such menu item. Instead, there is  a “Execute Behaviour Script” option, but it is greyed out.

Consequently I can see no way to run the script.

Now, by taking a different approach, and generating a fresh Custom Table:

If I right click on the Custom Table in the  Project Browser:, and follow “Features” I am offered the options to “Edit Behaviour” and “Edit Internal Code.”

When I select Edit Internal Code I am presented with a new tab that shows the parent Custom Table, with beneath (i.e. subservient) it “Internal Code”, and beneath that “Code” and “script”.

When I put something in this ‘new’ version of script, save and close it, then the “Execute Behaviour Script” command is no longer greyed out, and can be actioned (I think).

However, having done that, the code snippet that I dropped in using the second editing technique is not visible using the first technique, and vice versa.

Can someone please explain to me why there are apparently two different script receptacles, and what, if anything, should go in code?

Many thanks

BTW: I've tried this on different machines, with both v16.1 and v17.1 and am seeing the same result.
44
Hi Takeshi, I tried to create a more detailed UML class diagram now. Two important features are missing from my point of view:

  • I cannot create attributes. Copilot says: "The current implementation has a limitation: the set_element_property tool treats custom properties as "Tagged Values" in EA, not as proper UML dass attributes."
  • I cannot add cardinalities.
Is there also a work-around?
45
Can I change the Rectangle Notation to Icon Notation? I tried several ways. set_element_property does not change diagram object properties which would be necessary for my understanding.

Can I tell MCP the size of the created elements?
46
I've had the same experience. It's a great timesaver, if you know what the result should look like.

If you have no clue, it might be very time consuming to figure out where exactly it goes astray.

Geert
47
I tried it and it was successful. ArchiMate_ApplicationComponent has beeen assigned correctly to component.  Many thanks, Takeshi.

Hopefully also the rest will be created. But I think so.
48
I've similarly asked, AI to help with javascripts and never once has one it generated code that worked without modification, often AI hallucinated non-existent API calls. That being said it has reduced time to write code from hours to abot 20 to 30 mins
49
Hi Viking,

I will try to offer a prompt for ArchiMate 3, but could you try if the MCP add-in works for ArchiMate?

1. launch Enterprise Architect, create a new ArchiMate diagram and then leave it (keep open)
2. for your LLM, tell the rule like the following:

Quote
When we create an ArchiMate component in Enterprise Architect, its type is 'ArchiMate3::ArchiMate_ApplicationComponent'.

3. then ask to your LLM like:

Quote
Create a new ArchiMate component named 'Test' in the currently open diagram in Enterprise Architect.
50
Up until now, all my EA scripting has been done in VB, but with the advent of Scriptlets I thought that I should move to JavaScript, and in my laziness, and prompted by Ian's post I thought "let's ask Chat GPT to write some of the code..."

The results are fascinating: it has quite confidently generated the code, but included lines such as this:

var diags = Repository.GetDiagramsByName(name);

....which would be admirable if the Repository class actually provided a "GetDiagramsByName" method. Unfortunately there is only GetDiagramByID and GetDiagramsByGUID, so it seems that ChatGPT has simply invented its own method!

It was quick to apologise once I pointed out, but doesn't inspire confidence.
Pages: 1 ... 3 4 [5] 6 7 ... 10