Table of Contents
Creating Custom BI Essentials
Within the 3DX environment is a new tool suit called BI-Essentials which based on a rule color codes the data to allow quick visualization of the rule. These rules can be geometric or attribute based in nature, I’m going to show you how to create your own custom BI-Essentials.
Data Structure
To create a custom BI-Essential, there are 7 files we have to create in the appropriate install directory’s, the image below shows the relationship between the files, this relationship is defined by file names and the system expects the files to be in specific directory’s.
The file are found in the following directory’s;
- Customization Content – C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\plmcompass\PLM1\BICusto.CATRsc
- Customization Definition – C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\plmcompass\PLM1\VPM\<UniqueName>.CATRsc
- Customization Legends – C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\msgcatalog\<UniqueName>NLS.CATNls
- Customization Colors – C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\msgcatalog\<UniqueName>Color.CATRsc
- Customization Types – C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\plmcompass\PLM1\VPM\<UniqueName>Rules.CATRsc
- Customization Rule 1 / 2 – C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\knowledge\scripts\<UniqueName>.CATRule
Note:- The Rule Files can be merged into one file or left separate, one for the colors rule of the specification tree and one for the color rule of the 3D Geometry.
BICusto.CATRsc
The BICusto.Rsc or BI Customization Resource file is the entry point and contains the unique name of the custom BI Essentials. The file contains the unique names of the custom BI Essentials and their scope. Its required that the name of the custom BI Essential ends with ‘Analysis‘.
CatiaWidgets1BIAnalysis.Scope="ALL"; CatiaWidgets2BIAnalysis.Scope="ALL";
The key work Scope can be defaulted to “All” or replaced with any one of the workshops shown below.
- PRDWorkshop=”VPM_Physical_Editor”;
- CATPLMNavExamineModeWorkshop=”Examine”
- CATPLMEditorWorkshop=”RFLP_Editor”
- DELPPRLiveProcessWks=”PPR_Live_Process”;
- DELPPRLiveResourceWks=”PPR_Live_System”
- ImmNavWorkshop=”VPM_Navigator”
- UNIWorkshop=”Universal_Workshop”
- DELPPRAuthFoundationWks=”PPR_Editor”
- DELLiveSimulationWks=”Live_Simulation”
Step 1 – Add a new Custom BI Essentials in to the BICusto.CATRsc file
Within the C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\plmcompass\PLM1\BICusto.CATRsc file add the following code;
TestBIAnalysis.Scope="ALL";
TestBIAnalysis.CATRsc
The ‘TestBIAnalysis.CATRsc’ file contains the file skeleton of the custom BI Essentials, the name of the Legend file, Color File, and Rule file, the number of colors and then the legends and colors them selves ( the legend and colors are just the names not the real legends or colors).
Notice that this points to tree other files, and matches the diagram at the top of the page where the ‘Custom Definitions‘ file points to three other files Customization Legends, Customization Colors, and Customization Types.
// Links to File Names LegendNlsFile = "TestBIAnalysisNLS"; ColorRscFile = "TestBIAnalysisColor"; TypeRuleDefinitionFile = "TestBIAnalysisRules"; // Version NUmber of the BI Essentils Version="3"; // Number of Colors and Legends NumberOfColors = "4"; // Color and Legend Alias Names LegendId1 = "Legend_1"; ColorId1 = "Color_Red"; LegendId2 = "Legend_2"; ColorId2 = "Color_Green"; LegendId3 = "Legend_3"; ColorId3 = "Color_Yellow"; LegendId4 = "Legend_4"; ColorId4 = "Color_Blue";
Step 2 – Create a new TestBIAnalysis.CATRsc file
Within the C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\plmcompass\PLM1\VPM folder create a new file called ‘TestBIAnalysis.CATRsc’ and add the following code;
LegendNlsFile = "TestBIAnalysisNLS"; ColorRscFile = "TestBIAnalysisColor"; TypeRuleDefinitionFile = "TestBIAnalysisRules"; Version="3"; NumberOfColors = "4"; LegendId1 = "Legend_1"; ColorId1 = "Color_Red"; LegendId2 = "Legend_2"; ColorId2 = "Color_Green"; LegendId3 = "Legend_3"; ColorId3 = "Color_Yellow"; LegendId4 = "Legend_4"; ColorId4 = "Color_Blue";
TestBIAnalysisNLS.CATNls
The ‘TestBIAnalysisNLS.CATNls’ file defines how the alias name maps to the actual displayed text values. If this file was not defined then the displayed name of the custom BI essentials would be ‘TestBIAnalysis’ the name Custom BI Essential defined in the ‘BICusto.CATRsc’ file in Step1 and the displayed labels for the four colors would be ‘Legend_1’, ’Legend_2’, ‘Legend_3’, and ’Legend_4’, also defined in the CATRsc file in Step2.
Step 3 – Create a new TestBIAnalysisNLS.CATNls file
Within the C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\msgcatalog folder create a new file called ‘TestBIAnalysisNLS.CATNls’ and add the following code;
TestBIAnalysis = "Test Custom BI Essentials"; Legend_1 = "Legend 1 Status."; Legend_2 = "Legend 2 Status."; Legend_3 = "Legend 3 Status."; Legend_4 = "Legend 4 Status.";
TestBIAnalysisColor.CATRsc
The ‘TestBIAnalysisColor.CATRsc’ file defines the ‘RGBA’ colors for each of the label colors, again the alias name for the color is given the actual color definition in terms of RGBA.
Step 4 – Create a new TestBIAnalysisColor.CATRsc file
Within the C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\msgcatalog folder create a new file called ‘TestBIAnalysisColor.CATRsc’ and add the following code;
Color_Red.RGBA="255|0|0|0"; Color_Green.RGBA="0|255|0|0"; Color_Yellow.RGBA="255|255|0|0"; Color_Blue.RGBA="0|0|255|0";
TestBIAnalysisRules.CATRsc
The ‘TestBIAnalysisRules.CATRsc’ file defines the names of the rules for the color and labels that will be applied to the specification tree (VPMReference) and to the 3D Geometry space (VPMRepReference), these rules can be merged into one rule and that’s what I’m going to do to simplify the custom BI Essential.
Step 5 – Create a new TestBIAnalysisRules.CATRsc file
Within the C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\plmcompass\PLM1\VPM folder create a new file called ‘TestBIAnalysisRules.CATRsc’ and add the following code;
Color.Rule.VPMReference = "TestBIAnalysis"; Label.Rule.VPMReference = "TestBIAnalysis"; Color.Rule.VPMRepReference = "TestBIAnalysis"; Label.Rule.VPMRepReference = "TestBIAnalysis";
TestBIAnalysis.CATRule
Now for the fun part:
Step 6 – Create a new TestBIAnalysis.CATRule file
Within the C:\Program Files\Dassault Systemes\BXXX\win_b64\resources\knowledge\scripts folder create a new file called ‘TestBIAnalysis.CATRule’ and add the following code;
/*=====Argument list====== ThisObject=ProductOccurrence Parameters=RuleContext The Argument list is OOTB and Automatically Provides Objects for the two Variables*/ // The Product Reference is Required to Retrieve the Attribute Data //Product Occurrence Let ProductRef( VPMReference ) Let RepRef(VPMRepReference) Let RepInst(VPMRepInstance) // Variables Required for the Color and Label Data Let sColor( String ) Let sLabel( String ) // Variable for the Custom Attribute Being Retrieved Let status( String ) // Determine if were Dealing with an Occurrence or an Instance If ( ThisObject->IsSupporting( "ProductOccurrence" )) { // Retrieve the Reference Product Set ProductRef = ThisObject.Reference } Else If ( ThisObject->IsSupporting( "VPMInstance" )) { // Convert to an Instance Object Let ioVPMInstance ( VPMInstance ) Set ioVPMInstance = ThisObject // Retrieve the Reference Product Set ProductRef = ioVPMInstance.Reference } Else If ( ThisObject->IsSupporting( "VPMReference" )) { Set ProductRef=ThisObject } Else If ( ThisObject->IsSupporting( "VPMRepReference" )) { Set RepRef=ThisObject Set ProductRef=RepRef.AggregatingReference } Else If (ThisObject->IsSupporting("VPMRepInstance")) { Set RepInst=ThisObject Set RepRef=RepInst.Reference Set ProductRef=RepRef.AggregatingReference } //Retrieve the Test_Attributes Value from the Reference Object status = ProductRef.GetAttributeString("Test_Attribute") // Check to Ensure that the Attribute is Not Null or Empty If (status <> NULL And status <> "") { // Validate the attribute Value and Set the Color and Label Values If ( status == "Case1" ) { sColor = "Color_Red" sLabel = "1|Case_1 : " + status + "|I_Design" } Else If ( status == "Case2" ) { sColor = "Color_Green" sLabel = "1|Case_2 : " + status + "|I_Design" } Else If ( status == "Case3") { sColor = "Color_Yellow" sLabel = "1|Case_3 : " + status + "|I_Design" } Else If ( status == "Case4" ) { sColor = "Color_Blue" sLabel = "1|Case_4 : " + status + "|I_Design" } } // Set the temporary Attribute Data in the Specification Tree for the Color and Label Parameters ->SetAttributeString( "MyLabelForPLMCompass" , sLabel ) Parameters ->SetAttributeString( "MyColorForPLMCompass" , sColor )