Customizing the compass

Technical Article

Abstract

This article shows how to customize the labels and the rendering of the compass by using Knowledge scripts.

Introduction

Conceptual Model

The Compass conceptual model is based on the identification of five topics which structure the whole PLM world and allow the user to orient himself and look for information in a structured way. The Compass is the visual representation of these five topics, divided into four quadrants, and a center.

The four quadrants are named according to the four cardinal directions:

This documentation concerns the four quadrants of the Compass, but not the Play button.

Capability Summary

This article describes the capability to customize the Compass.

This capability will be available only in the 3DLive Navigation window.

For each quadrant of the compass it will be possible to register a set of customizations.

Each customization will manage:

Each customization will rely on properties stored locally on each node of the 3DLive tree. A mechanism of rule scripts is proposed for evaluating properties.

Therefore when a customer extends the PLM Data model, and adds new PLM attributes to objects, it will be possible to enhance the compass to have it taking into account the "customer specific" information.

External View/Behavior

For information, the compass presented to the end-user will be the one delivered by Dassault Syst笥s, It is our STANDARD.

This Standard will be activated each time a user launches a new session.

PLM Compass

User Interface

The standard user interface of the compass made of the four quadrants of the compass is not modified.

In addition, a new list of choices is available to choose one customization among a list for each quadrant of the compass. The list also contains the default behaviors supplied by Dassault-Syst笥s.

Compass Customization 7

Compass Customization 8

Compass Customization 9

Customization

Customization Principle

The default behavior - reminder:

The four compass quadrants compute and display information about PLM Objects STATE relying on predefined PLM Attributes. These attributes belong to the basic PLM types.

For example: the north quadrant displays for each object a STATE related with the "people" topic relying on the V_LockOwner and V_Owner attributes.

These attributes are available on any Reference object (Part, Representation from any customization).

The customized behavior:

Let's suppose a customer deploy a customization of the PLM model this way:

Customized Behavior

Hence there will be a need for displaying two new STATES of PLM objects relying on Reviewer and Quality_Resp attributes (added by customization). This will lead to two customizations of the NORTH quadrant: "Review" and "Quality".

Parts created in the customer database will be either of type PartRef_Custo1 or PartRef_Custo2. In one 3DLive window a mix of these objects might be displayed at the same time.

So any quadrant customization has to declare the way an object STATE is computed on a per type basis. This means a customization is made of a set of script rules; each rule is associated to one type. When executing a quadrant customization, for each PLM object of the current window a rule is searched based on the object type. If one is found it is executed, otherwise a rule is searched based on the object father type. The searching process stops when reaching the PLMCore type level.

As a summary:

Without any Customization

The shading today defined by using the compass will be applied to:

Customization definition

Resource file and referenced script files:

To define the customization we need a description for:

All this information will be stored in a unique .CATRsc file named : CATPLMCompassCustomizationOfQuadrants.CATRsc

The script files contain the rule to get RGB, alpha (for transparency) value for a given Compass custo (for a unique defined type based on these three characteristics: customization , modeler, PLMCoretype) . The rule in the script computes RGB, alpha value getting the value of the PLM Attributes. This rule has been coded by the user.

Principles:

The files defined in the previous paragraph are used to set up the customization.

Here are the main steps of the process (shading and background color of the text of the specs tree):

Here are the main steps of the process (labels of the compass):

Note: The modification of script files in Session is not taken into account immediately. For that, the user has to launch another Session.

Sample of customization

File CATPLMCompassCustomizationOfQuadrants.CATRsc

Quadrant.West.NumberOfCustomizations = "1";
Quadrant.West.Cust1.NameOfCustomization = "Description Attr. Test";
Quadrant.West.Cust1.NumberOfColors = "2";
Quadrant.West.Cust1.Color.Rule.PLMProductDS = "Description_rule";
Quadrant.West.Cust1.Color.Rule.PLMRepresentationDS = "Description_rule";
Quadrant.West.Cust1.Label.Rule.PLMProductDS = "N1ScriptForPLMProductDS_Label";
Quadrant.West.Cust1.Col1.Legend = "HELLO";
Quadrant.West.Cust1.Col1.Red = "204";
Quadrant.West.Cust1.Col1.Green = "51";
Quadrant.West.Cust1.Col1.Blue = "255";
Quadrant.West.Cust1.Col1.Transparency = "0";
Quadrant.West.Cust1.Col2.Legend = "Nothing written";
Quadrant.West.Cust1.Col2.Red = "102";
Quadrant.West.Cust1.Col2.Green = "51";
Quadrant.West.Cust1.Col2.Blue = "51";
Quadrant.West.Cust1.Col2.Transparency = "0";

File Description_rule.CATRule in <os>\resources\knowledge\scripts directory.

if (ThisObject.V_description=="HELLO")
  Parameters->SetAttributeString("MyColorForcompass","204|51|255|0")
else
  Parameters->SetAttributeString("MyColorForcompass","102|51|51|0")

File Attributes_For_Rules.CATRsc in <os>\resources\msgcatalog directory.

Attributes.PLMProductDS = "PLM_ExternalID|V_organization|V_maturity|V_user|LOCKUSER|V_description";
Attributes.PLMRepresentationDS = "V_organization|V_maturity|V_user|LOCKUSER|V_description";

File N1ScriptForPLMProductDS_Label.CATRule in <os>\resources\knowledge\scripts folder.

let Value1(String)
let Value2(String)
let Value3(String)
let Property1(String)
let Property2(String)
let Property3(String)
let LabelDescription(String)
Value1 = ThisObject.PLM_ExternalID
Value2 = ThisObject.V_description
Value3 = ThisObject.LOCKUSER
Property1 = "Property1|"+"THE NAME IS : "+Value1+"|I_Purple"
Property2 = "|Property2|"+"THE DESCRIPTION IS : "+Value2+"|I_Red"
Property3 = "|Property3|"+"THE LOCK USER IS : "+Value3+"|I_Yellow"
LabelDescription=Property1+Property2+Property3
Parameters->SetAttributeString("MyLabelForPLMCompass",LabelDescription)

Capability to define rules based on instances is also provided. Here is a sample script for customizing a shading:

To work with instance: let ThisInstanceObject(VPMInstance)

To check if the is an instance: Parameters->HasAttribute("InstanceObject")

To get the instance: Parameters->GetAttributeObject("InstanceObject")

Note: If you try to access an InstanceObject which is not defined on the objet, the whole rule will fail. So, we strongly advice to check its availability with: if ( bAllowComputingRuleWithInstanceObject == TRUE )

let ThisInstanceObject(VPMInstance)
let bAllowComputingRuleWithInstanceObject(boolean)
bAllowComputingRuleWithInstanceObject = Parameters->HasAttribute("InstanceObject") if ( bAllowComputingRuleWithInstanceObject == TRUE ) { set ThisInstanceObject = Parameters->GetAttributeObject("InstanceObject") if (ThisInstanceObject.PLM_ExternalID =="ZDXRoue.1") Parameters->SetAttributeString("MyColorForPLMCompass","255|0|0|80") else Parameters->SetAttributeString("MyColorForPLMCompass","0|0|255|80") } else { Parameters->SetAttributeString("MyColorForPLMCompass","0|255|0|80") }

For defining rules on objects, there is a dedicated Resource file named

Attributes which can be used in rules

For defining rules on objects, there is a dedicated Resource file named

Attributes_For_Rules.CATRsc

Put in <os>\resources\msgcatalog directory.

Note: this file have been put in the directory msgcatalog, because the attributes defined may be used for other customizations (tree / icons etc…)

Here is its syntax:

Attributes.<Object_type>=”Attribute_1|Attribute_2|……|Attribute_n”;

Where attributes separated by a | are retrieved from DataBase.

Example of file Attributes_For_Rules.CATRsc :

Attributes.PLMProductDS = "PLM_ExternalID|V_description|V_organization";

Attributes.PLMRepresentationDS = "V_discipline|V_nature";

So there will be the possibility to define rules based on following attributes for the PLMProductDS real type:

ExternalID V_description V_organization

And these ones on PLMRepresentationDS real type :

V_discipline V_nature

Capability to define rules based on extensions is also provided. Here is a sample script for customizing a shading for the extension V_Elec_NumberOfPins:

 if (ThisObject.GetAttributeInteger("V_Elec_NumberOfPins")== 3)
   Parameters->SetAttributeString("MyColorForPLMCompass","255|0|0|80")
 else
  Parameters->SetAttributeString("MyColorForPLMCompass","0|0|255|80")

File Attributes_For_Rules.CATRsc for extensions support in <os>\resources\msgcatalog directory.

Attributes.PLMProductDS = "PLM_ExternalID|V_organization|V_maturity|V_user|LOCKUSER|V_description";
Attributes.PLMRepresentationDS = "V_organization|V_maturity|V_user|LOCKUSER|V_description";

Extension.PLMProductDS="PLMEleRefEquipment|PLMEleRefSplice";
Extension.PLMProductDS.CorrespondingDomainId="PLMElectricalDictionary|PLMElectricalDictionary";

Attributes.PLMProductDS.PLMEleRefEquipment="V_Elec_NumberOfPins|V_Elec_SubType";
Attributes.PLMProductDS.PLMEleRefSplice ="V_Elec_Length";

Syntax and integrity management

In a customization, if a color is not correctly defined:

In a customization, if no color is correctly defined, the entire customization will not be proposed.

Integrity Check :

If the end user defines many times the same set of custom attributes, only the first one will be taken into account.

If a color resulting from rule doesn't belong to the scope of defined colors, the customization will not be applied.

Customization Files localization

For *.CATRules files they have to be defined in the directory <os>\resources\knowledge\scripts\

For the unique Resource file named : CATPLMCompassCustomizationOfQuadrants.CATRsc it has to be defined in a directory Provider and role-dependant under <os>\resources\compass directory

Customization Files Localization

If the file is defined directly under the compass directory , it will be the one used , if no provider is defined (or if there is an invalid definition of the current provider)

Under the compass directory , there can be defined folders corresponding to a different provider. Under each provider directory , there can be defined folders corresponding to different roles.

If a CATPLMCompassCustomizationOfQuadrants.CATRsc is directly defined under a provider directory , it will be the one used if the role with which the user has connected is not found in the compass hierarchy (see image above).

Here is the list of allowed providers :

ENOVIA VPM : VPM1
3DXML : DXP
ENOVIA SmarTeam : SMT
ENOVIA V6 – Collaborative Business Process & Design data Management : MX1
ENOVIA V6 : PLM1
ENOVIA VPM V5 : EV5

Finally it will be the a CATPLMCompassCustomizationOfQuadrants.CATRsc file which is under the current connected role which will be used by the compass if everything is all right.

compass
  |- CATPLMCompassCustomizationOfQuadrants.CATRsc 
  |-Provider1
      |- CATPLMCompassCustomizationOfQuadrants.CATRsc 
      |- Role1.1
            |- CATPLMCompassCustomizationOfQuadrants.CATRsc 
      |- Role1.2
            |- CATPLMCompassCustomizationOfQuadrants.CATRsc 
...
  |-Provider n
      |- CATPLMCompassCustomizationOfQuadrants.CATRsc 
      |- Rolen.1
            |- CATPLMCompassCustomizationOfQuadrants.CATRsc 
      |- Rolen.2
            |- CATPLMCompassCustomizationOfQuadrants.CATRsc

The user or administrator have the opportunity to change the behavior depending on the workshop involved: There will be one CATRsc file per Workshop :

Corresponding CATRsc File Workshop involved
VPM_Navigator_CompassCusto.CATRsc VPM Navigator
VPM_Search_CompassCusto.CATRsc Search Workshop
VPM_Physical_Editor_CompassCusto.CATRsc Physical Editor Workshop
Examine_CompassCusto.CATRsc Examine Workshop
RFLP_Editor_CompassCusto.CATRsc RFLP Editor Worshop

These CATRsc files will be located in a directory like :

<os>\resources\plmcompass\PROVIDER\ROLE

There is a tool in the user interface enabling you to understand syntax errors in your customization files, this is the Compass Checker.

In the View Menu, select Check Compass Customization.

A report is generated.

When clicking on Check an item type the user have to select the geometry he wants to customize with the PLMCompass. The Compass Checker returns the character string of the of the type of the object. The user have to insert this string in the CATPLMCompassCustomizationOfQuadrants.CATRsc file.

Compass Checker Dialog Box

Limitations

Limitation #1:
The customization of the compass works only in VPM Navigator, Search and Physical Editor workshop
Limitation #2:
If no customization of the compass is defined, in its default working behavior, the background color of the tree won't change.
Limitation #3: 
The customization of the compass is based on attributes of the tree mask defined in the rules, or on the attributes defined in the 
Attributes_For_Rules.CATRsc file.
Limitation #4:
Update of information in the case of labels.
The displayed information in the label for selected objects are always refreshed from DataBase.
These information (as in the default behavior of the compass today defined) may be "fresher" 
than the information relative to the 3D shading  and the Tree  Background color.
Limitation #5:
In the resource File CATPLMCompassCustomizationOfQuadrants.CATRsc, 
for the lines about display of customization names and legends only English language is taken into account.
Other characters (French, Japanese) aren't managed.

Quadrant.North.Cust1.NameOfCustomization = "Sales data";
Quadrant.North.Cust1.Col1.Legend = "Specific Parts ";
Limitation #6:
It is  not possible , in a CATRule to compare a character string with a space inside It or with special characters (as # ! etc...)
    example which doesn't work: 
        if (ThisObject.LOCKUSER=="MY NAME") 
        Parameters->SetAttributeString("MyColor","0|255|0")
Limitation #7:
The character comparison is Case Sensitive, so it is required to take into account the case.
Limitation #8:
The compass Checker Tool won't check the content of Attributes_For_Rules.CATRsc.
Limitation #9:
There is a limitation due to the transparency algorithm implementation.
As far as the polygons are concerned, the results might not be as expected,
when the triangles are blended with the rest of the scene.
As it is too costly and may adversely affect performance, polygons are not drawn using a Z order(ie: depth order).
Therefore it is not possible to be sure that when transparent polygon is blended, all the scene is drawn behind.
Transparent polygons are drawn at the end of the draw phase by they are not depth-stored,

Suggestion:
Paint objects without transparency or paint objects with a strong transparency.
Limitation #10:
Only PLM attributes and objects are taken in account (not features).

In Short

Two CATRsc file to write:

CATPLMCompassCustomizationOfQuadrants.CATRsc and Attributes_For_Rules.CATRsc.

All CATRule file described in CATPLMCompassCustomizationOfQuadrants.CATRsc to write.

History

Version: 1 [Jan 2007] Document created