Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: ADucci on January 19, 2018, 07:29:21 pm

Title: Apply Model Filters to specific diagram type permanently
Post by: ADucci on January 19, 2018, 07:29:21 pm
I love the functionality of the model filters, specifically where you can automatically hide connectors which dont "belong" on a specific view (probably using the model type) -- is there any way to permanently create a rule that automatically applies a diagram filter to a specific type of diagram across the repository?

Thanks

Title: Re: Apply Model Filters to specific diagram type permanently
Post by: PJK on January 24, 2018, 02:05:50 am
You can use the "Set Visible Relations" window (Ctrl-Shift-I) to permanently hide some connectors on a diagram. Not exactly what you are looking for (without writing a script), but it should be useful.
Title: Re: Apply Model Filters to specific diagram type permanently
Post by: Nabil on January 24, 2018, 11:23:19 pm
Hey ADucci,

Are you saying you want to hide all connector on a specific diagram type? If yes extend a diagram and set Show Relationships False

Also check model validation http://www.sparxsystems.com.au/enterprise_architect_user_guide/13.5/automation/model_validation_broadcasts.html (http://www.sparxsystems.com.au/enterprise_architect_user_guide/13.5/automation/model_validation_broadcasts.html) can be handled better from an Addin

http://www.sparxsystems.com.au/enterprise_architect_user_guide/13.5/automation/ea_onrundiagramrule.html (http://www.sparxsystems.com.au/enterprise_architect_user_guide/13.5/automation/ea_onrundiagramrule.html)

HTH
Nabil
Title: Re: Apply Model Filters to specific diagram type permanently
Post by: ADucci on January 25, 2018, 06:37:22 pm
Thanks Nabil, Philip.

I will look into these as a solution.  And Yes. I have extended Sparx to create my own diagram types i.e profile::behavior_view and profile::structure_View, and as a rule... i never want to see structure connectors on a behavior view and behavior connectors on a structure view (something like that... )

I was looking at the diagram filters and its so close to what I want.. just that you cannot create a filter on (Diagram type AND connector type)

I think the script idea is best (EA_OnRunDiagramRule)  --

Its just strange that other Sparx Users dont find that they have this same requirement -- I know how to hide connectors on a single diagram, but we have so many diagrams that I wanted a standard rule.

Cheers.
Title: Re: Apply Model Filters to specific diagram type permanently
Post by: kdm on March 13, 2018, 04:35:09 am
Hi,
I have similar requests.
you can create an own MDG and define your own connectors.
In the shape script of the connector you can check the current diagram

shape main
{
if(hasProperty("diagram.mdgtype","myMDG::diagram-name"))
{
// implement your connecor drawing here für this diagram
    moveto(0,0);
    lineto(100,0);
} else{
// if now drawing is defined here the connector isn't shown
}

}