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 - jk

Pages: [1]
1
Hello all,

I would like to write a javascript to generate automatically (after right-clicking in the project browser > "scripts" > "the script.js") a certain structure within a package.

Have you any ideas how to do this? I have no idea yet.


Thanks in advance!

2
Ok thanks,

but -sorry- I do not know how to print (in the console) or in a file the respective ElementIDs.

Code: [Select]
var elementCollection as EA.Collection;
elementCollection = Repository.GetElementSet("select t_object.Object_ID from t_object where object_type = 'Port' and (select count(*) from t_connector where t_connector.End_Object_ID = t_object.Object_ID) = 0",2);
// ...here I would like to get the console output/file write...of all respective IDs which are not connected

To the second issue (SScripter.exe error): When I run it in debug mode, I can not copy the whole debug output to clipboard.


 :-[

3
Hello,

now I added your example query into the function of the Script "RecursiveModel Dump Example" for testing:

Code: [Select]
function DumpElements( indent, thePackage )
{
// Cast thePackage to EA.Package so we get intellisense
var currentPackage as EA.Package;
currentPackage = thePackage;

// Iterate through all elements and add them to the list
var elementEnumerator = new Enumerator( currentPackage.Elements );


Session.Output(Repository.GetElementByID (Repository.SQLQuery("select * from t_object where object_type = 'Port' and (select count(*) from t_connector where t_connector.End_Object_ID = t_object.Object_ID) = 0")));



}


After clicking "Run script" in the EA Script-Editor, I get the error-message "SScripter.exe is not working - Close Program - Debug Program".
When I start "Run Debugging", then the script put out any outputs in the Debug window (e.g. "[1895347727]                  xyz (PackageID=3734)").

Why I get the SScripter.exe error message and why I do not get the respective ID of the "not-connected" ports?


Thanks!

4
I do not understand what  the System Output is printing.

Code: [Select]
Session.Output(Repository.SQLQuery("select * from t_object where object_type = 'Port' and (select count(*) from t_connector where t_connector.End_Object_ID = t_object.Object_ID) = 0"));

It looks like xml and brings "all" functions but not the name of the not-connected ports of the whole model. :(

What is wrong with my query? I added the line above in the EA javascript.

Thanks!

5
Thank you, I will try it!  :)

6
Oh thanks.

That would be nice!  :)  :)


I tried it, but it isnt working.



BR

7
Hello together,

maybe I wrongly expressed me issue:
I want to be able to find all unconnected/not-connected ports within the overview of the EA model.
I would like to develop it in C# or Javascript (inside of Enterprise Architect).

Is there any way to do this?

Thanks a lot.

8
Ah thank you!  :)

Is it possible to figure out which connectors are truly connected to other ports/or "hanging in the air"?
Based on the elementIDs it should be possible to find recursively the connection between them?

Thanks,



9
Hello all,

After working sometimes with the C# Framework for Enterprise Architect, I want to be able to generate a table which lists all objects in the model and shows me, in how many reports (0; 1; >1) each object is used.

Is it possible to do this with the C# Framework to develop such a AddIn for EA? I have no idea how to do this.


Thanks in advance!

BR


10
Hello together,

thank you for the links / ideas. So I will read it!


BR

11
Hello,

I use Enterprise Architect and i am a newbie in creating AddIns for EA with C#.
After trying and modifying the EA-CSAddin for Visual Studio from the sparxsystems website, I had a little success, the first "hello-world" AddIn works.  :)

The first question is:
Do you know where I can find some other small (and not too complicated) C# examples to learn more about the powerful AddIn functionality?
In my opinion the "Automation Guide" is very detailled but I miss some examples.
Otherwise I still have a problem with understanding the "hierarchy" of the different usable classes like "Repository", "Element", "Diagram" and "Connector" and I am not able to use these for my specific project (AddIn).

I have a existing EA-project and would like to check with an AddIn, which ports inside of ANY diagrams are connected with other inputs/outputs -> "consistency check". Is it possible to list via C# all existing connectors and then check the connection between them?
Another topic is to write a AddIn, which can copy the currently activated Diagram in the clipboard but NOT in svg-type. It should be in typical image-type to paste it in another tool.

I hope you can help me to improve my yet not existing knowledge in developing C# Addins for EA. :-)


Thank you very much

Pages: [1]