Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - vrieg

Pages: [1] 2 3 4
1
General Board / SysML V2
« on: May 16, 2025, 01:39:38 am »
Hello,

I would be curious about the SyML V2 activities/progress from Sparx.
I am wondering if the solution would require polarion or be server based anyhow as many other solutions that are currently popping up.
Are there any updates that can be shared?

2
Automation Interface, Add-Ins and Tools / Re: Usng EA-API from MATLAB
« on: January 03, 2025, 06:12:07 am »
ok I managed. It is possible using the .NET interop assebly in MATLAB similar as it would be done in C#.
This will do the job.

3
Automation Interface, Add-Ins and Tools / Usng EA-API from MATLAB
« on: January 02, 2025, 07:09:21 pm »
Hey there,

did some one use EA API from MATLAB?
Maybe via MATLAB/python integration? I would like to work with tags and plot their values.
Python is nice, but MATLAB would be way better for parts of the evaluations.
Thanks in adance.

4
yes this is what i did now I added them to the mdg in term of xml document and had to ensure to import the uml types again to the projects.
I need this to use sparx importer/exporter to office and to enable transferring information from/to stereotypes

5
I added UML Types e.g. taggedvalues to an MDG .
However within the project I dont see them. How can I access those tagged values from am MDG that is included as xml reference in EA16?

6
General Board / Re: SysML Instance Modelling
« on: October 22, 2024, 01:44:48 am »
We do it quite similar. We have a template block, parts, ports ibd.... this block is marked as template block via tags and stereotypes.
We then have scripts to inherit, derive, create variations of this block but all of those are also specified by the generalization relation ship in a bbd and then instantiated as needed.

7
General Board / Re: Generate parts by associations through scripting
« on: October 05, 2024, 04:08:20 am »
I would be interested in your solution as well. Did you find a solution how to keep the parts/ports synchronized when creating them via a script.

I do more or less the same I create an Aggregation, then the parts I set the PropertyType of the parts to the parent block. Then I synchronize all tags, create an ibd and add all parts/ports to the ibd. But I loose the sychronization.
However I want to have own guids for the embedded elements this is reached.

8
ok thanks understood.

9
Automation Interface, Add-Ins and Tools / Add and connect elements via query
« on: September 18, 2024, 09:40:13 pm »
Hello all,
is there a way to add elements and the connection to other elements via queries?
I am wondering if there is a way to add a graph to EA as known from working with graph databases.

10
i think the model can get rather complex so ok this seems to be the way to do it.
thanks a lot.

11
Hello,
I have a rather complex metamodel with an mdg and c# scripts for automation to generate model-elements based on the metamodels stereotypes and relationships.
Now I would like to do calculations and evaluations based on the created data inside the model and make use of their relation.
Is there a good way to for example read the tagged values of element a tag1 and tag2 build the sum tag3=tag1+tag2 and updated tag3 based on the calculation.
In case one of the tags1 or tag2 change i would like to do a re calculation of tag3.
can i show this updated tag3 in a diagram or a user form?
In the end I think I should iterate through the model, do several calculations and then provide an report in textual format.

Any idea how to approach this?
I thought about addinn scripts and maybe something like ea-matic but maybe there are better approaches?

12
It has been a mixture of both. Some whitespace of the VBA script at the line ending causing the deletion loop not to be entered and the missing update.
But with Geert's EA-Matic it seems to work now :)

13
Hello,

I would like to delete multiple elements at once using EA API.
Due to some reason the diagram does not get updated after deleting die diagram object.
Do I miss a command. I tries already with GPT assistants but I could not figure it out.
Is there a DiagramRefresh or something like this needed?

   'iterate through the connected elements
   'iterate through the list and add them to the diagram if this has not yet done
   dim key0, DiagramObj
   dim notConnectedElements
   set notConnectedElements = CreateObject("Scripting.Dictionary")
   
   
   for each DiagramObj in diagram.DiagramObjects
      dim elementToDelete
      elementToDelete=true
      dim currentElement
      set currentelement = Repository.GetElementByID(DiagramObj.ElementID)

   
      'iterate through all elements that dont have a connection to rootElement and that are not the rootElement istel
      for each key0 in connectedElements.Keys
         if ( DiagramObj.ElementID = key0  and connectedElements.Exists(DiagramObj.ElementID)) then
            elementToDelete=false
            exit for
         end if
      next
      
      if elementToDelete and DiagramObj.ElementID <> rootElement.ElementID then

         DeleteParts rootElement, currentElement
         ' Delete the diagram objects associated with the element
         DeleteDiagramObjects diagram, currentElement
         rootElement.Update()
         Repository.ReloadDiagram(diagram.DiagramID)
         'Repository.ReloadDiagram(diagram.DiagramID)   
      end if
   next

Sub DeleteDiagramObjects(diagram, elementToDelete)
   ' Iterate through the diagram objects and delete those associated with the element
   Dim j
   For j = diagram.DiagramObjects.Count -1 to 0 step -1
      Dim diagramObj
      Set diagramObj = diagram.DiagramObjects.GetAt(j)
      ' Check if the diagram object is associated with the element to be deleted
      If diagramObj.ElementID = elementToDelete.ElementID Then
         ' Delete the diagram object
         diagram.DiagramObjects.Delete(j)
         exit for
      End If
   Next
   Repository.ReloadDiagram(diagram.DiagramID)
End Sub

14
ah my fault i did a mistake in setting the checkbox. thanks for the hint

15
Hello,

I am working on a C# add-in for EA. Right now, I was using EA without admin rights, but another Add-In requires opening EA with admin rights.

Therefore, I would like to register my own C# addin for EA usage with admin privileges.
Does anyone know what would be required to do?

Right now I have,:
private bool register(Type type)
{
   bool isAlreadyRegistered = isAlreadyRegisteredInHKCR(type);
      
   if (!isAlreadyRegistered && isComVisible(type))
   {
      
      // software classes
      RegistryKey controlKey = Registry.CurrentUser.CreateSubKey(@"Software\Classes\" + type.FullName);
      controlKey.SetValue(string.Empty,type.FullName);
      RegistryKey clsidKey = controlKey.CreateSubKey("CLSID");
      clsidKey.SetValue(string.Empty,type.GUID.ToString("B"));
      
      //CLSID
      RegistryKey classKey = Registry.CurrentUser.CreateSubKey(@"Software\Classes\CLSID\" + type.GUID.ToString("B"));
      classKey.SetValue(string.Empty,type.FullName);
      
      //implemented category
      Registry.CurrentUser.CreateSubKey(@"Software\Classes\CLSID\" + type.GUID.ToString("B") + @"\Implemented Categories");
      Registry.CurrentUser.CreateSubKey(@"Software\Classes\CLSID\" + type.GUID.ToString("B") + @"\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}");
      
      //inprocerver
      RegistryKey inprocKey = Registry.CurrentUser.CreateSubKey(@"Software\Classes\CLSID\" + type.GUID.ToString("B") + @"\InprocServer32");
      inprocKey.SetValue(string.Empty,"mscoree.dll"); //hardcoded
      inprocKey.SetValue("ThreadingModel","Both"); //hardcoded?
      inprocKey.SetValue("Class",type.FullName);
      inprocKey.SetValue("Assembly",type.Assembly.FullName);
      inprocKey.SetValue("RuntimeVersion",type.Assembly.ImageRuntimeVersion);
      inprocKey.SetValue("CodeBase",type.Assembly.EscapedCodeBase);
      
      //version
      RegistryKey versionKey = Registry.CurrentUser.CreateSubKey(@"Software\Classes\CLSID\" + type.GUID.ToString("B") + @"\InprocServer32\" + type.Assembly.GetName().Version);
      versionKey.SetValue("Class",type.FullName);
      versionKey.SetValue("Assembly",type.Assembly.FullName);
      versionKey.SetValue("RuntimeVersion",type.Assembly.ImageRuntimeVersion);
      versionKey.SetValue("CodeBase",type.Assembly.EscapedCodeBase);
   
      //ProgID
      RegistryKey progIdkey = Registry.CurrentUser.CreateSubKey(@"Software\Classes\CLSID\" + type.GUID.ToString("B") + @"\ProgId");
      progIdkey.SetValue(string.Empty,type.FullName);
   }
   return isAlreadyRegistered;
}

Starting EA with admin rights seams not to perform registration during Visual Studio Build

Pages: [1] 2 3 4