Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
51
As the help says: it's a collection. So you need to iterate and use GetAt.

q.
52
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.


 :-[
53
General Board / Re: Help - element and connector labels
« Last post by Glassboy on July 12, 2018, 06:39:58 pm »
Specifically for connectors, the 'label visibility' suggests that there are top and bottom labels for middle, source, target and realized item.  By default, it appears that the connector name is set into the middle top label and the stereotype into the middle bottom.  But how are the others set ?

I'm not anywhere near a machine with Sparx EA on it but look at the other tabs for the properties of a connector.  On the one with the multiplicity/cardinality you can set the source and target descriptions. 
54
I rarely use the in-build script engine but I have the very same issue when trying to debug. I claimed it to my very old OS and just use Run (with no debug) wehn needed. Probably someone else knows what to install to get the debugger to run. If not contact Sparx' support via mail.

Also look at Arshad's suggestion. The GetElementSet is probably better in your case.

q.
55
Suggestions and Requests / Re: Archimate connector stereotype labels
« Last post by qwerty on July 12, 2018, 05:47:50 pm »
You could investigate that by looking into the shapescript itself- Geert has published a github repo with all shape scripts.

q.
56
Hu. A defect *realizing* looks like intentionally being implemented. I'd probably would implement <<occur>> as connector in a profile. But finally you are absolutely free to invent your own notation.

q.
57
General Board / Re: Visio import: Element text invisible
« Last post by qwerty on July 12, 2018, 05:35:45 pm »
Uh. Still looked like the old YABB so I was just assuming this being a newer version.

q.
58
The entire piece of code wont work together in the way youve used .
  • In your query you are getting entire columns from t_object.  Get Object_ID alone
  • Repository.SQLQuery - Will return Object ID's in the XML format. You need to get that list and iterate it
  • Repository.GetElementByID - You can pass only one object ID in this call at a time .
  • You should use Repository.GetElementSet to get the details from a list of objectID's

To Use ElementSet
Code: [Select]
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);
For More details on Repository.GetElementSet

HTH
Arshad
59
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!
60
General Board / Help - element and connector labels
« Last post by matthew.james on July 12, 2018, 03:45:18 pm »
Elements and connectors appear to have multiple labels, or at least label positions - but how do I set text for each label ?

Specifically for connectors, the 'label visibility' suggests that there are top and bottom labels for middle, source, target and realized item.  By default, it appears that the connector name is set into the middle top label and the stereotype into the middle bottom.  But how are the others set ?

The user guide discusses various options for controlling label appearance but all rely on selecting the label - which can't be done if it has no text.  I can't find anything in the user guide about how to set the text values.  Or are they all controlled by model features in some pre-defined or connector specific way ?

Is there any way for me to 'override' the text in these labels - for example to set the bottom middle label to something different to the stereotype.
Note: I am working with Archimate shapes and one thing I'm trying to do is to work around a bug (feature?) whereby the stereotype is not displayed as the middle bottom text label (see http://www.sparxsystems.com/forums/smf/index.php/topic,40127.0.html)
Pages: 1 ... 4 5 [6] 7 8 ... 10