Polymorphic Diagrams
Previous Topic  Next Topic 

Each diagram has a 'Polymorphic' property. This is optional, it is set in the Diagram Details form.

When set then a Selector panel appears at the top left of the diagram. As you select a variant it is shown on the diagram window,in both ControlDraw and the Reviewer.


Polymorphic diagrams are diagrams that have Variants - diagrams that do not have all the contents of the master version or that have different tagnames.

An exclusion variant of a diagram is a subset of the master diagram, a Tagname variant uses different names for the objects. The two variant types can be mixed in one variant on a diagram, but a single symbol is either excluded or has a different tagname.

Parts of the contents of the master diagram can be switched off in a Variant. For example some of the equipment modules in a Unit may not exist in a particular instance of the Unit. You can define a diagram Variant to show this. This means that you can draw a  'superset' diagram that covers all the alternative configurations of the particular type of object that you are drawing and then define via Variant tables the alternative versions of the unt.

Also a symbol can have a different tagname in a variant.

Variants cascade into the database build functions.

In the parent objects of a Polymorphic diagram you can select which variant of the diagram to use. If you select a Child diagram that is polymorphic then ControlDraw prompts with a list of the page variants. You have to enter the variant number that you wish to use, or 0 to use the master, which has no objects excluded.


Exclusion, Tagname or Child Var Variants       

There are three  types of Variant object

Tagname

Variant Tagnames are alternative tagnames to be used for the symbols on a variant.

Exclusion

A Variant not not contain the object

Note A Variant cannot be excluded if is has a Tagname, so in order to exclude a variant that already has a tagname you must clear the tagname first.

Child Var

You set the variant that is linked to an object in a variant.

This option lists only objects that have linked pages. If the page is polymorphic then you can choose from a drop down list in the cell which variant in the child page is used in the variant of the parent page. If the child page is not polymorphic then you cannot edit the cell.

You do not need to make diagrams with multiple copies of objects in order to be able to select different child page setting for objects.



Hiding Text and Links

When in Tagnames mode, you can  use "." to hide the Tag, User text and child link, or "," to hide just the child link, so you can create a variant without all the clutter of links and tagnames, for example for Graphics. The list in variant tagnames shows these by colour.

You can use Variants Special Symbols to display all the settings on the diagram


Paste Variants - For Quickly Setting or adding Variants

You can easily set large numbers of variants by using the Paste Variants button.

If you have a list of variants names in the clipboard then with Paste Variants you can create a new variants for each line in the clipboard.

You can also use it to set all the variant cells:

First use Copy Table

Then paste into a spreadsheet, setting the cells then copying the same area of the spreadsheet and then using Paste Variants.