Customize KBL Export of Mechanical Parts (ELE_ManagePartsAsKBLAccessory)

An opening ID is an entry point used to customize business logic. The Customize KBL export of mechanical parts opening ID allows you to customize the export of mechanical parts.

This opening ID is available in the Electrical Data Exchange resources resource set.

Note: For more information about customization by business rules, see Installation and Setup: Customize: Behavior: Data Setup: Customization by Business Rules.

This page discusses:

General Information

This opening ID is invoked when using the Export Electrical System command. It is called for any mechanical part that is aggregated under an electrical geometry linked to the electrical physical system selected in the command.

For more information, see Electrical Manufacturing Preparation User's Guide: Electrical Physical System Export in KBL: Exporting an Electrical Physical System in KBL.

This opening ID is used to specify for each mechanical part:

  • If the part is exported as a KBL accessory
  • The subtype to be set on the <accessory type>. By default, the <accessory type> is “undefined”.

Definition Description
PLM Opening ID ELE_ManagePartsAsKBLAccessory
Customization intent Computation
Execution context Client

Input Objects

Input objects must be of the following types:

  • ThisObject: ProductOccurence of a mechanical part.
  • Parameters corresponds to the context object.

Context Object Parameters

Parameter Name Type Read or Write Comments
ElectricalPartLinked ProductOccurence Read Electrical product linked to the input mechanical part with an assembly constraint. The value may be null.
IsKBLAccessory Boolean Write TRUE: the input mechanical part is exported as a KBL accessory.

FALSE: the input mechanical part is not exported.

Note: If the mechanical part is linked to an electrical part, the value is preset to TRUE.
KBLAccessoryType String Write The type of KBL accessory. The default value is “undefined”.

If the business rule for the opening ID is implemented:

Mechanical part linked to electrical part/support by assembly constraint Validation Export behavior
Yes Yes Mechanical part is exported as a KBL assembly part (<Assembly_part>) including the part and the linked device.
No Yes Mechanical part is exported as a single KBL accessory.

If the business rule for the opening ID is not implemented:

  • The mechanical parts linked by constraints in the electrical geometry are exported.
  • The isolated mechanical parts are not exported.

Sample

The following sample gives an example of the business rule syntax:

let BR_severity(Integer)
let BR_message(String)

//  get the input mechanical part occurrence
let PartOccurrenceToExport(ProductOccurrence)
set PartOccurrenceToExport = ThisObject

//Notify ( " mechanical part : ",PartOccurrenceToExport.Name())

// get the electrical part linked by mechanical constraint ( may be null )
let  LinkedElectricalPartOccurrence(ProductOccurrence)
if ( Parameters->HasAttribute("ElectricalPartLinked") )
{
	set LinkedElectricalPartOccurrence = Parameters->GetAttributeObject("ElectricalPartLinked")
	//if (  LinkedElectricalPartOccurrence<> NULL ) Notify (   "   linked to : ", LinkedElectricalPartOccurrence.Name())
	//	else Notify (  "   not linked  ")
	}

// the export status
let  KBLstatus(Boolean)
// the kbl accessory type
let  KBLtype(String)
KBLtype=""

// get the input mechanical part instance attribute : description
let PartInstance(VPMInstance)
set PartInstance = PartOccurrenceToExport.Instance
let kbl_export_param(String)
kbl_export_param = PartInstance.V_description

// get attribute description length
let len (Integer)
len=0
len=kbl_export_param.Length()
//Notify (  "      description :",kbl_export_param,  " <",len,">")

// if no value set for description  : the behavior is computed from linked electrical part
if ( len==0 )
{
	// check linked object
	let SupportOcc(SharedSupportPartOccurrence)
	set SupportOcc = LinkedElectricalPartOccurrence
	if( SupportOcc <> NULL )   // keep the part if linked object is a support
	{
		KBLstatus = TRUE
		KBLtype="fixing_part"
		//Notify ( "     => linked part is a support :  exported as Accessory type ",KBLtype)
		
	}
	else
	{
		KBLstatus = FALSE
	}
	
}
// value set for description 

else
{
	// search separator position isep in
	let  isep(Integer)
	isep=0
	isep = kbl_export_param.Search(":",0)
	
	// --- get export parameter : Keep or NoKeep
	let export(String)
	if ( isep>1)
	{
		export=kbl_export_param.Extract(0,isep)
	}
	
	//Notify ( "              kbl export status : ",export)
	
	// --- get the type value
	let kbl_type(String)
	if ( len > isep )
	{
		kbl_type=kbl_export_param.Extract(isep+1,len-isep-1)
	}
	//Notify ( "              kbl accessory type : ",kbl_type)
	
	if ( export == "Keep" )
	{
		KBLstatus = TRUE
		KBLtype=kbl_type
	}
	else
	{	
		KBLstatus = FALSE
	}
}




// valuate BR output parameters
Parameters->SetAttributeBoolean("IsKBLAccessory",KBLstatus)     // kbl export true or false
Parameters->SetAttributeString("KBLAccessoryType",KBLtype)     // kbl accessory type 

if ( KBLstatus==TRUE)
{
	BR_severity=0
	BR_message=PartOccurrenceToExport.Name()+" exported as KBL accessory type : "+KBLtype
}
else
{
	BR_severity=1
	BR_message=PartOccurrenceToExport.Name()+" not exported as KBL accessory" 
}
Parameters.Severity=BR_severity
Parameters.Message=BR_message

// Notify ( BR_message,"      ",BR_severity)