Book a Demo

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

Pages: [1] 2
1
I had the query with the existing elements a little bit different and that worked, yes. But I found the reason: The Object_Type of the element is different to the one in the Properties Window. Now I use the Stereotype instead, and it works.  :)

Sometimes "talking" about the problem helps. Thanks Geert.

2
The query seems correct.
Maybe you should first figure out how to find the elements that have such a child element.
That is not a problem and works just fine.

PS. I remember a weird behavior in one of the version of EA that an empty line was interpreted as the end of the query. The rest was simply not processed. Try removing the empty lines to see if that helps.
That sounds really weird.  :o  Tried it, but doesn't change anything.

3
The problem is, that the query does not find the elements with the missing child element. It lists all the elements, regardless whether the child element is existing or not.

4
I have trouble writing the correct SQL query for the following problem: I want to find all elements of a specific type which don't have a specific child element but can have other child elements.
My approach was:
Code: [Select]
SELECT DISTINCT obj.ea_guid AS CLASSGUID, obj.Object_Type AS CLASSTYPE, obj.Name

FROM t_object obj

WHERE NOT EXISTS (
SELECT * FROM t_object obj2 WHERE obj2.ParentID = obj.object_id AND obj2.Object_Type = 'SpecificType')
AND obj.Stereotype = 'Some Stereotype'

I am pretty sure, the solution is simple. So what am I missing?

5
Well, you have to find the elements you want to add the tagged value to by finding all elements in the selected package. And then you can use the EaScriptLib functions TVGetElementTaggedValue and TVSetElementTaggedValue from JScript-TaggedValue.

6
That is not what I would expect, but hey, if it works, it works  ;D

There's some truth to that. But it is still kind of unsatisfying that I have to distinguish between the two versions.

7
Yes, I saw that too. In both cases, it creates an MSXML 6.0 object. And the dll is installed for 32 bit and 64 bit.
When I force the created object to be "MSXML2.DOMDocument" the entire script works for 64 bit though.  :o

8
Sure  :)

So in EA 15 I am using the functions provided in JScript-XML in the EAScriptLib. It basically does that:
Code: [Select]
xmlDOM = new ActiveXObject("MSXML2.DOMDocument.6.0");
xmlDOM.loadXML("path\\to\\theXMLfile");

then I get the root node and later read single nodes:
Code: [Select]
rootNode = xmlDOM.documentElement;
...
xmlNode = rootNode.getElementsByTagName("nodeName");
if (xmlNode.length != 0)
{
    /* read data from node */
}

As I said, that works in EA 15. The same does not in EA 16 x64. There, the xmlNode.length is always 0. But loadXML did not return an error and the root node looks also the same.

9
I have a JScript reading an xml file. Everything is working fine in EA 15.2. Now I tested the script in EA 16.1 (x64) and neither xmlDom.selectSingleNode("/name") nor rootNode.getElementsByTagName("name") works.
Does anybody know why? The xml is loaded correctly and I can still get the rootNode with rootNode = xmlDom.documentElement.

10
Oh, okay. And I presume the Technology Rules are only available in version 16 and not 15.2, right?

11
Automation Interface, Add-Ins and Tools / Attribute Constraints in an MDG
« on: December 05, 2023, 07:25:20 pm »
Hi there!
I have an MDG defining a stereotype for a class. The stereotype has several attributes. But one of the attributes shall only be visible if another one has a specific value. Is that even possible and if yes, how? I thought about attribute constraints, but didn't find any example.

12
Ahh, I see. Thanks for clarifying that for me!

13
The text is now shown in the centre of the main shape. But I want it to be in the centre of the subshape, the turquoise rectangle attached to the "north-west" corner of the main shape. Unfortunately I have no idea how to add a picture to this post.

14
Automation Interface, Add-Ins and Tools / Shape Scripts: Text in Subshapes
« on: November 24, 2023, 12:01:48 am »
Hi,

I have a subshape located "outside" the main shape and I want to add text to it. How do I do that? The text always seems to be "attached" to the main shape, no matter what I try.

Code: [Select]
shape main
{
DrawNativeShape();
addsubshape("test", 100, 100);
setfillcolor(0,255,255);

shape test
{
h_align = "center";
v_align = "center";
RoundRect(-15,0,0,15,5,5);
if (HasTag("Test","Yes"))
{
SetFontColor(200,12,0);
print("TestText");
}
}
}

15
Hi there.

I am using the DLGInputBox from the JScript-Dialog Lib file. As promptText I am adding a list of words for the user to choose from. Usually it's only a couple of words and there's no problem. But sometimes the list is so long that the box doesn't fit on the screen any more. Is there a possibility to add a scrollbar or a drop-down menu to the text of the InputBox to avoid the window getting too big?

Cheers!

Pages: [1] 2