Hi Earnfried, and welcome to the forum.
Also, welcome to the wonderful world of EA hacking. Please check your sense of logic at the door.
If you're building an MDG Technology, you can right-click your custom diagram type (the one with the «stereotype» stereotype, not the «metaclass» one) and select Edit with Profile Helper. The profile helper allows you to set the various properties without having to know what the corresponding attributes are called.
Unfortunately, there's no option to specify "Show Namespace" in the profile helper. This probably means you can't specify this in an MDG Technology, but you could try a couple of likely-sounding attribute names and see if one works. You might get lucky.
Looking in the API, the
ShowFQN sub-property of
Diagram.StyleEx (as opposed to
Diagram.ExtendedStyle, of course) corresponds to the "Fully Qualified Namespace" option in the diagram properties dialog, as you've observed.
However, the main option "Show Namespace" is not in
Diagram.StyleEx but has its own property in the Diagram object: it's
Diagram.HighlightImports. This isn't obvious, but it is actually mentioned in
the API documentation. (The reason I bring it up is not to say RTFM but rather to remark on the fact that this particular idiosyncracy is documented -- this is not the norm when dealing with EA.)
Here's a simple diagram-context script you can use to check some diagram properties. You can add the others if you're interested, they're all listed on the page I linked above.
option explicit
!INC Local Scripts.EAConstants-VBScript
sub OnDiagramScript()
dim diagram as EA.Diagram
set diagram = Repository.GetCurrentDiagram()
if not diagram is nothing then
Repository.EnsureOutputVisible("Script")
Session.Output "HighlightImports: " & diagram.HighlightImports
Session.Output "ExtendedStyle: " & diagram.ExtendedStyle
Session.Output "StyleEx: " & diagram.StyleEx
else
Session.Prompt "This script requires a diagram to be visible", promptOK
end if
end sub
OnDiagramScript
One thing you may notice is that if you run this script in a completely new diagram, the complex properties are empty. EA doesn't fill them in until you change something in the diagram (eg add an element).
Why? Well, because.
HTH,
/Uffe