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.


Topics - m2i7c9k

Pages: [1] 2
1
Hi Guys,

I don't understand the EA v16.0.1605 (x64) behavior. I have MDG Profile with the stereotype with an icon (RGB 192,192,129) for the background, but EA shows it as a black square - and I don't know why. Because 2hrs ago, it works perfectly.
I'm going slightly mad. What is causing that? I don't change anything (close EA and re-open EA).

Does anybody know a workaround, please, how prevent that EA behavior?
Thanks

Mick

2
Hi Guys,

I please for help: I have shape scrip Provided interface, and I don't know how to hide
stereotype label, if I changed exposed interface to Required :(

What I'm missing? I looked at "query" books and EA help, but I can't find the answer.

Thaks a lot
Mick

---------------------------------------------------------------------------------------------------------
shape main
{
   fixedAspectRatio = "true";
   
   if(hasproperty("parentedge","top"))
   {   
      DefSize(13,40);
      DrawNativeShape();
   }
   
   if(hasproperty("parentedge","left"))
    {
      DefSize(40,13);
      DrawNativeShape();
   }
   
   if(hasproperty("parentedge","right"))
    {
      DefSize(40,13);
      DrawNativeShape();
   }
   
   if(hasproperty("parentedge","bottom"))
   {
      DefSize(40,13);
      DrawNativeShape();
   }
   
}

shape label
{   
   if(hasproperty("parentedge","top"))
   {
      SetOrigin("N",0,0);
      Print("#name#");
   }
   
   if(hasproperty("parentedge","left"))
   {
      SetOrigin("S",0,0);
      Print("#name#");
   }
   
   if(hasproperty("parentedge","right"))
   {
      SetOrigin("S",0,0);
      Print("#name#");
   }
   
   if(hasproperty("parentedge","bottom"))
   {
      SetOrigin("S",0,0);
      Print("#name#");
   }
   
   if(hasproperty("type", "required"))
   {
      Print("#name#");   
   }
   
   /*
   if(HasProperty("Type","Required"))
   {
      Print("#name#");   
   }
   */
}

3
General Board / EA 16 diagram position in browser
« on: September 02, 2022, 07:20:25 pm »
Hi guys,

I can't find in the release log when Sparx changed the diagram position in the Browser window.
Till ver. 15.x.xxx the diagram was always first under the parent package, and it was (4 me) better for working with elements in the package.
In EA 16.x.xxx, the diagram is unred the sub-packages.

Is there an option for that?

Thanks,
Mick

4
Automation Interface, Add-Ins and Tools / VBScript get mouse X/Y
« on: April 29, 2022, 05:00:52 pm »
Hi Guys,

it is possible in EA (VBScript) to get mouse coordinates and use them as position
for adding a new element to the diagram, pls?

Mick

5
General Board / SQL fragment for element with linked document
« on: January 31, 2022, 11:59:51 pm »
Hi Guys,

I have a BPMN diagram with activities that have a linked document.
So, I created a template with the fragment that sorts the diagram element (order by t_diagramobjects.RectLeft ASC, t_diagramobjects.RectTop DESC)
but I have no clue how "print" under the element it's a linked document?

Thanx for the advice,
Mick

6
Automation Interface, Add-Ins and Tools / Virtual document from vbscript?
« on: September 08, 2021, 03:12:57 am »
Hi guys,

please help me! I'm a bit "out of order", because I don't understand how works virtual documents.

Is is possible have 3 element on the diagram and print them by element type?

1 Diagram = 1 UseCase, 1, Class (stereotype="webpage"), 1 Class (stereotype="service")

And I have no idea how create template that read the diagram elements, and use 3 deferent templates
by element type, in one document,  document chapter?

Thanks for advice

Mick


7
Hi Guy,

pleas HELP :) I'd like to retrieve from SQLQuery only ONE value <DestID>.

Sub Main

   Repository.EnsureOutputVisible "Script"
   Repository.ClearOutput "Script"
   
   dim currentDiagram as EA.Diagram
   set currentDiagram = Repository.GetCurrentDiagram()
   
   for each currentDiagram in currentDiagram.SelectedObjects
      
      dim theElement as EA.Element
      set theElement = Repository.GetElementByID( currentDiagram.ElementID )   
      
      Dim sqlCmd
      sqlCmd = "SELECT " &  _
         "   Object_1.Object_ID AS DestID " &  _
         "FROM  " & _
         "   t_object  "  & _
         "   INNER JOIN t_connector INNER JOIN t_object AS Object_1 ON
t_connector.End_Object_ID = Object_1.Object_ID "  & _
         "   ON t_object.Object_ID = t_connector.Start_Object_ID "  & _
         "WHERE " &  _
         "    t_object.Object_ID = " & theElement.ElementID
      
      Dim queryResult
      queryResult = Repository.SQLQuery(sqlCmd)
      'LOGInfo (queryResult)
      
      getDiagramOccurences  (queryResult)

                The result id:
                2021-8-7 14:27:24 [INFO]: <?xml version="1.0"?>
               <EADATA version="1.0" exporter="Enterprise Architect">
          <Dataset_0><Data><Row><DestID>2</DestID></Row></Data></Dataset_0></EADATA>
                   
                But I want to <DestID> value
End Sub

Thanx a lot

Mick

8
Automation Interface, Add-Ins and Tools / interaction points
« on: August 04, 2021, 10:28:26 pm »
Hi Guys,

I'd like to know where is stored relation between the element and its interaction points?

Situation:
I have a diagram with class element and ProvidetInterface, but I can't find their relationship in the BD (MS SQL)?

img:https://ibb.co/02GpcjF
https://ibb.co/02GpcjF

My Goal:
I want to create VBScript that copy ProvidetInterface data and add them (insert) into t_attributes.

What am I missing?
Thanx.

Mick

9
Hi Guys,

is it possible to create the package by VBScript with "Exclude from Generated Report"?

sub main

   dim i

   dim msg
   dim iBox
   dim appName
   appName = "Package"
   
   dim thePackage as EA.Package
   set thePackage = Repository.GetTreeSelectedPackage()

   dim theElement as EA.Element
   set theElement = Repository.GetTreeSelectedObject()

   dim packages as EA.Collection
   set packages = thePackage.Packages
   
   dim elements as EA.Collection
   set elements = thePackage.Elements

   dim subPackage as EA.Package
   set subPackage = packages.AddNew("[data]", "Class")
        subPackage.what?
   subPackage.Update()
         
         
   Repository.Models.Refresh()
end sub

Thanks for HELP :)

Mick

10
General Board / Enum Class as Table Column?
« on: April 22, 2021, 08:26:14 pm »
Hi guys,

I can't figure out how can I add ENUM class associated (aggregation) to another Class?
I'd like to add the ENUM class name as Tabel Columnt name?

Thanks

MIck

11
Hi Gus,

Please help me: In my model, I have a class that has an attribute with a tagged value that
I want to use as destination DB Table.attribute.type.

Example:
Class(Person).Attribute(firstName).Type(string) ----> DB.Table(Person).Attribute(fistrName).Type(Varchar(250)

How can I achieve that?

Thanks for the advice.

Mick

12
Suggestions and Requests / VBScript: Select element in the browser tree
« on: January 21, 2021, 08:54:42 pm »
Hi Guys,

I can't figure out how c I select the element in the browser tree after adding new attributes to the element?
My code will select the newly added attribute in the Class, and I'd like to select the parent Class where I startred from.
Thanks for the advice.

sub main
   
   Repository.ClearOutput "Script"
   Repository.EnsureOutputVisible "Script"
   
   dim theElement as EA.Element
   set theElement = Repository.GetTreeSelectedObject()
   
   if not theElement is nothing and theElement.ObjectType = otElement then
      
      dim i, addedAttributeID
      
      Session.Output( "Working on element '" & theElement.Name & "' (Type=" & theElement.Type & _
         ", ID=" & theElement.ElementID & ")" )
      
      ' Create an attribute to work on
      dim attributes as EA.Collection
      set attributes = theElement.Attributes
      
      dim attName, attType, attScope
      dim newAtt, splitAtt
      
      dim iBox
      iBox=InputBox("Enter attribute", "Class Attribute", "attribute_name, string(150), public")
      
      if IsEmpty(iBox) Then
         exit sub
      else
         newAtt = iBox '"fullname, string(150), public"
         splitAtt = Array(Split(newAtt, ","))
         for each i in splitAtt
            attName = trim(i(0))
            Session.Output  attName
            attType = trim(i(1))
            Session.Output  attType
            attScope = trim(i(2))
            Session.Output  attScope
         next
         
         
         dim newAttribute as EA.Attribute
         set newAttribute = attributes.AddNew( attName, attType )
         newAttribute.Visibility(attScope)
         newAttribute.Update()
         attributes.Refresh()
         
         addedAttributeID = newAttribute.AttributeID
         
         Session.Output( "Added attribute: " & newAttribute.Name & _
            "(Type=" & newAttribute.Type & _
            ", ID=" & addedAttributeID & ")" )
      end if
   end if
   -->> SELECT the ELEMENT?
main

13
General Board / Tagged Value Window in EA 15.1.1526
« on: February 25, 2020, 08:22:25 am »
Hi Guys!

What is to happen when I click on the Editor's icon (Element group) and then click on the Tagged values? Because I do not see tagged value window :(
What I missed?

Thanks

Milan

14
Automation Interface, Add-Ins and Tools / MDG profile examle?
« on: July 31, 2019, 07:31:44 pm »
Hi Guys!

Does anyone have some MGD example with toolbox and icons for elements?
Somehow ea help does not help me :/

Thanx

15
Hi Guys,

I'm here again with the 2nd step of my code. The code below works on MSSQL, JET but PROGRES NO :/
Is there some special workaround for update/insert for PROGRES repository.

On PROGRES repository I've got the error: Object variable or With block variable not set.

Thanks


Public Sub UpdateEAObject(objName As String, objNote As String, objGUID As String, objType As EAObjectType)
        'Saving EA element by element type.
        'The eaObject could be a Package, a Diagram, and an Element.
       
        Dim eaObject As Object = Nothing

        If objType = 0 Then
            eaObject = EARep.GetPackageByGuid(objGUID)
        ElseIf objType = 1 Then
            eaObject = EARep.GetDiagramByGuid(objGUID)
        ElseIf objType = 2 Then
            eaObject = EARep.GetElementByGuid(objGUID)
        End If

        With eaObject
            .Name = objName
            .Notes = objNote
            .Update()
        End With

        EARep.RefreshOpenDiagrams(True)
    End Sub

Pages: [1] 2