Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Paolo F Cantoni on May 09, 2018, 05:11:09 pm

Title: addsubshape syntax for layouttype=border
Post by: Paolo F Cantoni on May 09, 2018, 05:11:09 pm
From the help...

To set the layout type you use the layoutType attribute, which must be set in the initialization attributes section of the script; in other words, before any of the methods are called. Valid values for this attribute are:


Unfortunately, neither the Help file nor the editor tool-tip show the exact syntax to be used for the addsubshape method with layouttype=border

Can a Sparxian, please enlighten me?

Paolo
Title: Re: addsubshape syntax for layouttype=border
Post by: Geert Bellekens on May 10, 2018, 03:01:48 am
Paolo,

Here are a few example shapescripts that use layouttype=border:
I guess you should be able to deduct the proper syntax this way as well.

https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library/search?utf8=%E2%9C%93&q=layouttype%3Dborder&type= (https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library/search?utf8=%E2%9C%93&q=layouttype%3Dborder&type=)

Geert
Title: Re: addsubshape syntax for layouttype=border
Post by: Paolo F Cantoni on May 10, 2018, 10:57:45 am
Yes, I was aware of that syntax, but is that ALL you can do with it?  This hinges on the word "additional".  If this was the only variant for layouttype=border, I'd have expected different.  Additional normally implies in addition to.

That's my question.

Paolo
Title: Re: addsubshape syntax for layouttype=border
Post by: Geert Bellekens on May 10, 2018, 04:33:07 pm
I read it like:

This requires an additional argument to the addsubshape method

And indeed we see

   addsubshape("triangle","center");
   addsubshape("name","s");


That must be it no?

Geert

Title: Re: addsubshape syntax for layouttype=border
Post by: Paolo F Cantoni on May 11, 2018, 11:03:16 am
I read it like:

This requires an additional argument to the addsubshape method

And indeed we see

   addsubshape("triangle","center");
   addsubshape("name","s");


That must be it no?

Geert
No, the description is technically ambiguous I could read it that way, but I could (reasonably) read it differently.  The absence of a formal syntax for that use case in BOTH the help system and the tooltip, makes it even more so.

FWIW, exactly such an ambiguity is what started me on this "modelling lark" four decades ago!  (Blame it all on James Martin)

Paolo
Title: Re: addsubshape syntax for layouttype=border
Post by: KP on May 11, 2018, 11:36:08 am
I read it like:

This requires an additional argument to the addsubshape method

And indeed we see

   addsubshape("triangle","center");
   addsubshape("name","s");


That must be it no?

Geert
No, the description is technically ambiguous I could read it that way, but I could (reasonably) read it differently.  The absence of a formal syntax for that use case in BOTH the help system and the tooltip, makes it even more so.

FWIW, exactly such an ambiguity is what started me on this "modelling lark" four decades ago!  (Blame it all on James Martin)

Paolo

Geert is of course correct.
Title: Re: addsubshape syntax for layouttype=border
Post by: Paolo F Cantoni on May 11, 2018, 03:39:39 pm

Geert is of course correct.
Yes, but he's not a Sparxian. I, too, have used the syntax he mentioned for many years, but I was secretly hoping there were more syntaxes where one could combine the location and sizing.

Paolo
Title: Re: addsubshape syntax for layouttype=border
Post by: KP on May 11, 2018, 03:44:56 pm
For layouttype="border" there are two arguments: name and location. For other layout types, there are either one, three or five arguments: name, width, height, X position, Y position.
Title: Re: addsubshape syntax for layouttype=border
Post by: Paolo F Cantoni on May 11, 2018, 03:47:07 pm
For layouttype="border" there are two arguments: name and location. For other layout types, there are either one, three or five arguments: name, width, height, X position, Y position.
Could you please get the help and editor tooltips updated to reflect that, please?

Paolo