Recent Posts

Pages: 1 ... 8 9 [10]
I'm trying to get a jscript to work that creates a diagram for each package and adds child elements and packages to the diagram.  I've managed to get the child elements to be added to the diagram but not the child packages.

I think its because I'm passing a Package ID to Diagram.Object.ElementID

theDiagramObject.ElementID( childElement.ElementID);
//Substituted the above code that works with element with this below
theDiagramObject.ElementID( childPackage.PackageID);

Here is a snippet of code
Code: [Select]
function AddDiagramToPackage(  thePackage )
    // Cast thePackage to EA.Package so we get intellisense
    var currentPackage as EA.Package;
    currentPackage = thePackage;

    var theDiagram as EA.Diagram;

    theDiagram = thePackage.Diagrams.AddNew( thePackage.Name, "Logical" );

    var diagramObjects as EA.Collection;
    diagramObjects = theDiagram.DiagramObjects;
    // iterate through all child elements and add them to the diagram -THIS DOES WORK
    var elementEnumerator = new Enumerator( currentPackage.Elements );
    while ( !elementEnumerator.atEnd() )
        var childElement as EA.Element;
        childElement = elementEnumerator.item();
var theDiagramObject as EA.DiagramObject;
theDiagramObject = diagramObjects.AddNew("","");
theDiagramObject.ElementID( childElement.ElementID );

    // iterate through all child packages and add them to the diagram -THIS DOESN'T WORK
    var childPackageEnumerator = new Enumerator( currentPackage.Packages );
    while ( !childPackageEnumerator.atEnd() )
        var childPackage as EA.Package;
        childPackage = childPackageEnumerator.item();
  var theDiagramObject as EA.DiagramObject;
theDiagramObject = diagramObjects.AddNew("","");
theDiagramObject.ElementID( childPackage.PackageID);


I've scoured the help but can't seem to see how to add packages to a diagram via the automation interface. Any thoughts/help welcome.
Suggestions and Requests / Re: Need help to get the position of elements and relations
« Last post by KP on January 19, 2018, 01:23:07 pm »
(left + right)/2  ,  (top + bottom)/2
Thanks for suggestion,

can you please help, how to find/ calculate the absolute center points of the object.

Hi Daniel,

I haven't checked for QuickLinker, but for other elements of the MDG, we don't have to restart EA to get the updated MDG installed.  The QuickLinker is a global structure (to which each MDG supplies a portion), so I suspect that it is not possible to unload the existing QuickLinker for a specific MDG (probably because each entry is NOT tagged with the MDG(s) that provided it).  Hence a restart is required.  You can append (as you load MDGs dynamically), but you can't remove.

General Board / Re: Unlock a Block element
« Last post by qwerty on January 19, 2018, 08:42:42 am »
Guillaume, this will not show the red exclamation mark. It will just disable the OK button in the properties.

General Board / Re: Unlock a Block element
« Last post by Guillaume on January 19, 2018, 08:36:10 am »
You can lock elements even when the security is not enabled.
Having the locked Block displayed on a diagram, a right click will show "Lock Element" - if the padlock is highlighted it means that the element is locked so you simply need to click on this option (Lock Element).

General Board / Re: How to debug a template fragment with Custom SQL
« Last post by Nabil on January 19, 2018, 02:14:22 am »
To debug your query use sql builder crtl+f. Yes only packageId, diagramId and objectId are the possible arguments
Hi there,

I'm writing template fragments and need to play around with the SQL queries as I'm not that familiar with it.

Now it happens that I get more or less useful error messages from EA and I wonder: which way could I use to debug a template fragment?

I tried to create a search first and use it. It seems that it's not always possible - should it be?
(like usage both of #PACKAGEID# and #OBJECTID# inside a query)

Even if I don't get an error, the fragment does nothing because my query didn't deliver anything - so I need to evaluate why.

it's extremely convenient to say the least.

Then why complaining?  ;D

General Board / Re: Unlock a Block element
« Last post by Nabil on January 18, 2018, 11:50:22 pm »
If possible share the package some where. Will check it
Pages: 1 ... 8 9 [10]