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 - Helmut Ortmann

Pages: 1 ... 61 62 [63]
931
Hello Thomas, Hello Geert,

thanks a lot!

I have my workaround and I will post a bug report.

Kind regards,

Helmut

932
Hi,

thanks a lot. Looks simple but I wasn't aware of it.

Kind regards,

Helmut

933
Hello,

I have a Composite Structure Diagram with a class and two parts inside the enclosing class. The two parts are connected by a flow or a connector. The flow is selected and the addin should return the flow after calling GetContextItem. It returns the enclosing class instead.

Without the enclosing task everything works as expected.

Thanks,

Helmut

934
Hi,

it's worth reading it. My suggestion is to also read the e-book InsideEA. Some advanced features are only to accomplish by using SQL.


Enjoy reading and trying it,

Helmut

935
Hi Paulus,

I attach an example in C#. It works and I use this snippet to attach a linked note to a diagram object.

                        EA.Element el = (EA.Element)Repository.GetContextObject();
                        EA.Package pkg = Repository.GetPackageByID(el.PackageID);
                        if (pkg.IsProtected || dia.IsLocked || el.Locked || dia == null) break;

                        // save diagram
                        Repository.SaveDiagram(dia.DiagramID);
                        
                        EA.Element elNote = null;
                        try
                        {
                            elNote = pkg.Elements.AddNew("", "Note");
                            elNote.Update();
                            pkg.Update();
                        }
                        catch { break; }

                        // add element to diagram
                        // "l=200;r=400;t=200;b=600;"

                        // get the position of the Element
                        EA.DiagramObject diaObj = null;
                        foreach (EA.DiagramObject dObj in dia.DiagramObjects) {
                            if (dObj.ElementID == el.ElementID)
                            {
                                diaObj = dObj;
                                break;
                            }
                        }
                          int left = diaObj.left + 2*(diaObj.right - diaObj.left);
                        int right = diaObj.right + 2 * (diaObj.right - diaObj.left);

                        string position = "l=" + left.ToString() +";r=" + right.ToString() + ";t=" + diaObj.top.ToString() + ";b=" + diaObj.bottom.ToString() + ";";
                        EA.DiagramObject diaObject = dia.DiagramObjects.AddNew(position, "");
                        dia.Update();
                        diaObject.ElementID = elNote.ElementID;
                        diaObject.Update();
                        pkg.Elements.Refresh();

Other ressources are:
- Online Help EA (examples)
- E-Book ScriptingEA from Thomas Kilian

Kind regards,

Helmut




936
Hello Geert,

thanks a lot. I just found the solution. I think a hidden method.

It works!

Kind regards,

Helmut

937
Hello,

I wanted to use the undocumented function Repository.Execute(..). I can't see it with Visual Studio. The other functions are available. In the Object Catalog it's marked gray as opposed to black for the other methods.

Is there a special trick to use this function?

Kind regards,

Helmut

Pages: 1 ... 61 62 [63]