Allowing Symmetric Product Computation Using Fsx_Symmetry_ID Business Logic

As an administrator, you can use the Fsx_Symmetry_ID business rule to allow the computation of the symmetric product of a given product in a given context.

During the symmetry operation, you can automate the definition of the stacking for the symmetrized bundle.


Before you begin: You are granted the Owner role to access the Data Setup app.
See Also
Symmetrizing Bundles
About Data Setup for Fastening
  1. From the Compass, click Data Setup app.
  2. Select Fastening business logic resources in the right panel.
  3. Add a new resource table by right-clicking it.

  4. Select Fsx_Symmetry_ID as the BL opening that you want to customize.

  5. Add the script in the BL script editor.

    This business rule has two inputs defined in the parameters list.

    • iRootReference: Root reference using the current editor root element
    • iOriginalElement: Element from which a symmetric element must be found. It can be an instance or a reference.
    This business rule has one output: oSymmetricElement: Resulting symmetrical element of iOriginalElement under iRootReference.
    Note: To correctly reconnect the bundle link, set two business rules on the Fsx_Symmetry_ID node: one to find symmetric references and one to find symmetric instances.

    Example of business rule:

    For VPMInstance

    /* Rule created by PV9 3/13/2026 */ 
    /* ---------------------------------------------------------------
       Business Rule : FindSymmetricElement
       
       Input :
         Parameters (RuleContext) – contains :
           - iOriginalElement  (VPMInstance)  : Instance element 
           - iRootReference    (VPMReference) : current root context reference.
           - oSymmetricElement (VPMInstance)  : Result to valuate
    --------------------------------------------------------------- */
    
    /* 1. Retrieve input parameters */
    let iOriginalElement (VPMInstance)
    iOriginalElement = Parameters.GetAttributeObject("iOriginalElement")
    let iRootReference (VPMReference)
    iRootReference = Parameters.GetAttributeObject("iRootReference")
    
    
    /* 2. Replace "Left" by "Right" */
    let sOriginalName (String)
    sOriginalName = iOriginalElement.Name
    
    if (sOriginalName.Search("Left") > -1)
    {
      let sTargetName (String)
      sTargetName = ReplaceSubText(sOriginalName, "Left", "Right")
    
      /* 3. Iterative search */
      let oSymmetricElement (VPMInstance)
      oSymmetricElement = NULL
      let lStack (List)
      lStack->Append(iRootReference)
      let bContinue (Boolean)
      bContinue = true
      let iSecurity (Integer)
      iSecurity = 0
    
      for iSecurity while bContinue
      {
          iSecurity = iSecurity + 1
    
          /* Stop conditions */
          if (lStack->Size() == 0)
          {
              bContinue = false
          }
          if (oSymmetricElement <> NULL)
          {
              bContinue = false
          }
          if (iSecurity >= 10000)
          {
              bContinue = false
          }
    
          if (bContinue)
          {
              /* Pop last element */
              let iLastIndex (Integer)
              iLastIndex = lStack->Size()
              let oCurrentRef (VPMReference)
              oCurrentRef = lStack->GetItem(iLastIndex)
              lStack->RemoveItem(iLastIndex)
    
              /* Get child instances */
              let lInstances (List)
              lInstances = oCurrentRef->Query("VPMInstance", "")
              let i (Integer)
              for i = 1 while i <= lInstances->Size()
              {
                  let oInst (VPMInstance)
                  oInst = lInstances->GetItem(i)
    
                  let sInstName (String)
                  sInstName = oInst.Name
    
                  if (sInstName == sTargetName)
                  {
                      oSymmetricElement = oInst
                      bContinue = false
                  }
                  else
                  {
                      /* Push child reference onto stack for further exploration */
                      let oChildRef (VPMReference)
                      oChildRef = oInst.Reference
                      if (oChildRef <> NULL)
                      {
                          lStack->Append(oChildRef)
                      }
                  }
              }
          }
      }
    
      /* 4. Set output parameter */
      if (oSymmetricElement <> NULL)
      {
          Parameters.SetAttributeObject("oSymmetricElement", oSymmetricElement)
      }
    }
    

    For VPMReference

    This business rule looks for elements that have the same name as the input element, but with 'Left' replaced by “Right.” For example, if the reference name is “Left Gear,” it looks for a 'Right Gear' element.

    /* Rule created by PV9 3/13/2026 */ 
    /* ---------------------------------------------------------------
       Business Rule : FindSymmetricElement
       
       Input :
         Parameters (RuleContext) – contains :
           - iOriginalElement  (VPMReference) : Reference element 
           - iRootReference    (VPMReference) : current root context reference.
           - oSymmetricElement (VPMReference) : Result to valuate
    --------------------------------------------------------------- */
    
    /* 1. Retrieve input parameters */
    let iOriginalElement (VPMReference)
    iOriginalElement = Parameters.GetAttributeObject("iOriginalElement")
    
    let iRootReference (VPMReference)
    iRootReference = Parameters.GetAttributeObject("iRootReference")
    
    /* 2. Replace "Left" by "Right" */
    let sOriginalName (String)
    sOriginalName = iOriginalElement.Name
    
    if (sOriginalName.Search("Left") > -1)
    {
      let sTargetName (String)
      sTargetName = ReplaceSubText(sOriginalName, "Left", "Right")
    
      /* 3. Recursive search */
      let oSymmetricElement (VPMReference)
      oSymmetricElement = NULL
    
      let lStack (List)
      lStack->Append(iRootReference)
    
      let bContinue (Boolean)
      bContinue = true
    
      let iSecurity (Integer)
      iSecurity = 0
    
      for iSecurity while bContinue
      {
          iSecurity = iSecurity + 1
    
          /* Conditions d'arrêt */
          if (lStack->Size() == 0)
          {
              bContinue = false
          }
          if (oSymmetricElement <> NULL)
          {
              bContinue = false
          }
          if (iSecurity >= 10000)
          {
              bContinue = false
          }
    
          if (bContinue)
          {
              /* Dépiler le dernier élément */
              let iLastIndex (Integer)
              iLastIndex = lStack->Size()
    
              let oCurrentRef (VPMReference)
              oCurrentRef = lStack->GetItem(iLastIndex)
              lStack->RemoveItem(iLastIndex)
    
              /* Get child instances */
              let lInstances (List)
              lInstances = oCurrentRef->Query("VPMInstance", "")
    
              let i (Integer)
              for i = 1 while i <= lInstances->Size()
              {
                  let oInst (VPMInstance)
                  oInst = lInstances->GetItem(i)
    
                  let oChildRef (VPMReference)
                  oChildRef = oInst.Reference
    
                  if (oChildRef <> NULL)
                  {
                      let sChildName (String)
                      sChildName = oChildRef.Name
    
                      if (sChildName == sTargetName)
                      {
                          oSymmetricElement = oChildRef
                          bContinue = false
                      }
                      else
                      {
                          lStack->Append(oChildRef)
                      }
                  }
              }
          }
      }
      /* 4. Set output parameter */
      if (oSymmetricElement <> NULL)
      {
          Parameters.SetAttributeObject("oSymmetricElement", oSymmetricElement)
      }
    
    }
    

  6. Return to the Data Setup app tab.
  7. Save the information in the database.
  8. Drag and drop the resource to the required collaborative space.
    BL scripts are taken into account.