Important: The business logic to customize label for "Assigned Object" can be found here: Automatic text and format for a Work Instruction - LabelIntroduction
This document is intended to provide a detailed guide and example on how to customize a Business Logic (BL) for opening id "DELWKIDMULabelPropertiesSubComponent_BL_ID" to customize the information displayed and formatting of a "Label" created in a Work Instructions View for the Sub-Component of Assigned Object.
The OOTB BL "DELWKIDMULabelPropertiesSubComponent.CATRule" can be customized to change the information displayed in the label and change the color, font style & size for the text in the Label created for the Sub-Component of the assigned Mfg. Item to the Operation.
Version – 2025x FD03 (FP.CFA.2524)
Pre-requisites:
Licenses –
MDG (Mechanical Designer): To create 3D Data (Physical Product Structure)
PPL (Process Engineer): To create Process Planning Data (MBOM and BOP)
PWD (Work Instruction Author): required to create Text Annotation work instructions (Label).
Disclaimer: Licenses mentioned above are as per 2025x documentation.
| PLM Opening ID | DELWKIDMULabelPropertiesSubComponent_BL_ID |
| Customization intent | Execution |
| Execution context | Client |
| Usage | Using this BL, we can set the text and text format of the Label created in the Work Instruction View for the Sub-Component of the assigned Mfg. Item to the Operation.
This BL is invoked when you author Labels on a Sub-Component of either a Manufacturing Item or a Resource or an Operation-Output using Label
|
| CATRuleExit | DELWKIDMULabelPropertiesSubComponent.CATRuleExit |
| Sample CATRule | DELWKIDMULabelPropertiesSubComponent.CATRule |
Explanation
In DELMIA's Work Instructions Application, when creating a "Label" using the "Label" command, one can choose to create a label for the "Assigned Object" or the "Subcomponent of Assigned Object".
The Business Logic to customize the Label for "Assigned Object" is already discussed here: Link
When the option to create Label for "Subcomponent of Assigned Object" is selected and the subcomponent is selected from the 3D View, it shows that subcomponent in the "Subcomponent Selection" section.
When the subcomponent is selected in the "Subcomponent Selection" section, out of the box (OOTB), a label is created showing the Occurrence Name of the Subcomponent (Physical Product).
The provided sample BL is customized to display the description of the Physical Product reference, description of the instance of the Physical Product and custom attribute "Custom_Part_Number" of the Physical Product reference.
Sample Script
Note: To understand how the script works, please read the comments in the code, which explain each line.
Sample Data Set
To demonstrate the use case, the following data set is used.
The operation "Install Bracket 2" has three types of components visible in its 3D View:
Current
Parallel
Previous in System
Here, label will be created for all these three types of operations using the customized BL.
Sample Data Set 3DXML
Download the following data set to test the BL.
Working Explanation
Here, let's create a label using the customized business logic for the operation "Install Bracket 2 A".
Open the data set in "Work Instructions" application.
Activate the "Install Backet 2 A" operation and select the "Activate Views for Operation" command.
The "View.1" will get activated.
Note: If view is not available, please create it using the "Create View for Operation" command.Launch the "Label" command from the "Instruction Authoring" section.
In the "Label" window, select "Subcomponent of Assigned Object".
Select the "Bracket_Cap" shown in yellow color. and in the "Subcomponent Selection" section of the "Label" window, select "Bracket_Cap A (Bracket_Cap.1)"
A Label will be created for the "Bracket_Cap A (Bracket_Cap.1)" showing the Reference Description, Instance Description and Part Number (Custom Attribute). Adjust the position of the label as required.
Note: Here, the background color of the label is decided based on the Buildup Type of the selected object. For example, Yellow for sub-component of the object, which is linked to the Mfg. item assigned to the current operation (Buildup Type is "Current"). This logic is defined in the provided sample business logic.Similarly create the label for the "Shaft" (Shown in Orange color tone) and the other "Bracket_Cap" (Shown in blue color tone)
Video Demonstration
Possible Customizations
The provided sample script is commented well to explain it's working. However, below are some possible customizations, which can be made in the script.
Display Additional Product Reference Attribute in the Label
To display additional product reference attributes in the label, uncomment and repeat the following lines of code for the Product
To display additional product reference attributes in the label, uncomment and repeat the following lines of code for the Product Reference Attributes:
/*---
If productRef->HasAttribute("Attribute_Name")
{
InformationToShow = ""
set AttributeToShow = productRef->GetAttributeString("Attribute_Name") //Get Attribute of the Product Reference
InformationToShow = "Attribute Name: " + AttributeToShow
OutputTextList.Append(InformationToShow) //Uppend the string in the list of string to show in label
}
--*/Note: Here replace "
Attribute_Name" with the name of the reference attribute of the Physical Product
Display Additional Product Instance Attribute in the Label
To display additional product instance attributes in the label, uncomment and repeat the following lines of code for the Product Instance Attributes:
/*---
If prodInstance->HasAttribute("Attribute_Name")
{
InformationToShow = ""
set AttributeToShow = prodInstance->GetAttributeString("Attribute_Name") //Get Attribute of the Product Instance
InformationToShow = "Attribute Name: " + AttributeToShow
OutputTextList.Append(InformationToShow) //Uppend the string in the list of string to show in label
}
--*/Note: Here replace "
Attribute_Name" with the name of the instance attribute of the Physical Product
Display Additional Custom Attribute in the Label
To display additional custom attributes of the Physical Product in the label, uncomment and repeat the following lines of code for the Product Attributes.
For Custom Reference Attributes:
/*---
If productRef->IsASortOf("Custom_Extension_Type")
{
InformationToShow = ""
set AttributeToShow = productRef->GetAttributeString("Custom_Attribute_Name") //Get custom attribute of the Product Reference
InformationToShow = "Custom Attribute Name: " + AttributeToShow
OutputTextList.Append(InformationToShow) //Uppend the string in the list of string to show in label
}
--*Note: Here replace "
Custom_Extension_Type" with custom extension type added on the Physical Product Reference and "Custom_Attribute_Name" with the name of the custom reference attribute.
For Custom Instance Attributes:
/*---
If prodInstance->IsASortOf("Custom_Extension_Type")
{
InformationToShow = ""
set AttributeToShow = prodInstance->GetAttributeString("Custom_Attribute_Name") //Get custom attribute of the Product Instance
InformationToShow = "Custom Attribute Name: " + AttributeToShow
OutputTextList.Append(InformationToShow) //Uppend the string in the list of string to show in label
}
--*Note: Here replace "
Custom_Extension_Type" with custom extension type added on the Physical Product Instance and "Custom_Attribute_Name" with the name of the custom instance attribute.
Customize the Label Background color For the Objects with Different Buildup Type
Following lines of code defines the R, G, B values for the label background color based on the Buildup Type of the selected object. Customize these values as required for the different buildup types:
//==========================================================
// SECTION-4: defining label back-ground color based on Buildup Type
//==========================================================
/* Note: For BL on target, the pointed object could be a MfgItem or a Resource */
/*---
- Set the "BackgroundColor" string value in above format: "R, G, B"
- The range for the R, G, B values is as given above: (R: 0-255, G: 0-255, B: 0-255)
--*/
if (BuildupType == "Current")
{
BackgroundColor = "255, 255, 200" //Default Value "255, 255, 200"
}
else if (BuildupType == "Parallel")
{
BackgroundColor = "255, 165, 100" //Default Value: "255, 165, 100"
}
else if (BuildupType == "Resource")
{
BackgroundColor = "100, 255, 128" //Default Value: "100, 255, 128"
}
else if (BuildupType == "Context")
{
BackgroundColor = "230, 230, 230" //Default Value: "230, 230, 230"
}
else if (BuildupType == "Previous in System")
{
BackgroundColor = "100, 200, 230" //Default Value: "100, 200, 230"
}
else /* Previous */
{
BackgroundColor = "100, 128, 255" //Default Value: "100, 128, 255"
}Customize the Other Label Formats
Following lines of code sets the Font Style, Font Size and other properties for the label. Customize them as required.
//==========================================================
// SECTION-5: Set-Label Format
//==========================================================
/*---Set font Style. Enter the font file name (with .ttf extension)---*/
//3DX Fonts available in: 3DExperience_Installations\\win_b64\\resources\\fonts\\TrueType
//Other Fonts available in: C:\\Windows\\Fonts
OutputFormatList.Append(List("fontName", "segoeui.ttf"))
OutputFormatList.Append(List("fontSize", "4")) //Value range: 1-99
OutputFormatList.Append(List("fontColor", "0, 0, 0")) //Value Format: "R, G, B" [Range- (R: 0-255, G: 0-255, B: 0-255)]
OutputFormatList.Append(List("backgroundColor", BackgroundColor)) //Value Format: "R, G, B" [Range- (R: 0-255, G: 0-255, B: 0-255)]
OutputFormatList.Append(List("borderColor", "0, 0, 0")) //Value Format: "R, G, B" [Range- (R: 0-255, G: 0-255, B: 0-255)]
OutputFormatList.Append(List("borderThickness", "1")) // Range: 1-8
OutputFormatList.Append(List("borderLineType", "1")) //Posiible Values: "0" (No Border), "1" (Solidw Line), "2", "3", "4", "5", "6", "7"
OutputFormatList.Append(List("leaderEndType", "0")) //"0": Leader with Arrow end; "1":Leader with Circle end; "2": no Leader endNote: In the provided sample script, comments are added to describe the possible values for all the formatting parameters.
References
User Assistance:
User Assistance:
DELWKIDMULabelPropertiesSubComponent_BL_ID
How to Deploy
You may refer the below page for Business Rule deployment.
For deployment using Data Setup app following Resource set ID and opening needs to be used:
Resource Set ID:
Opening ID:
Fact Type: This opening ID supports multiple fact types as defined in DELWKIDMULabelPropertiesSubComponent.CATRuleExit which can be found in "<3DExperience_Installation_Path>\\win_b64\\resources\\knowledge\\scripts". In data setup, it is required to deploy the BL separately for each fact type for which you want to customize the BL.
