FastenerFunctions (no NLS) Functions

This package lets you navigate between fastened parts and fasteners within a same session. You can retrieve fasteners that are linked to a given part.

This page discusses:

BelongsToSameFst

This method checks if two engineering connections (MCXs) have the same fastener instance.

Signature

BelongsToSameFst(iMCX1 :  MCX, iMCX2 : MCX, : Integer

Arguments

NameInput/OutputRequired?TypeComment
iMCX1In MCX The first MCX to check if it belongs to the same fastener as the second MCX.
iMCX2In MCX The second MCX to check if it belongs to the same fastener as the first MCX.

ReturnType

Integer

  • Returns 1 if the MCXs belong to the same fastener.
  • Returns 0 if the MCXs do not belong to the same fastener.
  • Returns -1 if an error occurs. For example, if the MCXs are not fastener MCXs.

Example

Let iMCX1 (MCX)
Let iMCX2 (MCX)
Let bSameFastener (Integer)
bSameFastener = -1
bSameFastener = BelongsToSameFst(iMCX1,iMCX2)

If(bSameFastener == 1)
      {
      // The MCXs belong to the same fastener
     …
      }
      Else
            {
            If(bSameFastener == 0)
                  {
                  // The MCXs don't belong to the same fastener
                  …
                  }
                  Else
                        {
                        // Error: possible not fastener MCXs
                        …
                        }
            }

IsAFstMcx

This method checks whether the input connection is a fastener connection or not.

Signature

IsAFstMcx(iMcx :  MCX) : Boolean

Arguments

NameInput/OutputRequired?TypeComment
iMcxInMCXThe MCX to check if it is associated to a fastener instance or not.

ReturnType

Boolean

  • Returns 1 if this is a fastener MCX.
  • Returns 0 if this is not a fastener MCX.

Example

Let iMCX (MCX)
Let bFastenerMCX (Boolean)
bFastenerMCX = TRUE
bFastenerMCX = IsAFstMcx (iMCX)

RetrieveFasteners

This method retrieves the list of fasteners that fasten the input part.

Signature

RetrieveFasteners(iPart : ProductOccurrence) : List

Arguments

NameInput/OutputRequired?TypeComment
iPartInProductOccurrenceRepresents the part occurence.

ReturnType

List

Example

 /* Variables declaration */
Let ListOfFasteners (List)
Let NumberOfFasteners (Integer)
Let pFastenerOcc (SpotAssyFastenerOccurrence)
Let IndexOfFastener (Integer)

/* Retrieve list of Fasteners occurrences which fasten ThisOccurrence ProductOccurrence */
Set ListOfFasteners = RetrieveFasteners (ThisOccurrence)
Set NumberOfFasteners = ListOfFasteners ->Size()
Set IndexOfFastener = 1
For IndexOfFastener while IndexOfFastener <= NumberOfFasteners
{
 			Set pFastenerOcc = ListOfFasteners -> GetItem (IndexOfFastener)
 			If (pFastenerOcc <> NULL)
				{
			 				…
				}
				…
}
…

RetrieveFastenersInContext

This method retrieves the fastener occurrences that fasten the given input part.

Signature

RetrieveFastenersInContext(iPart : ProductOccurrence, iContext : VPMReference) : List

Arguments

NameInput/OutputRequired?TypeComment
iPartInProductOccurrenceThe part for which the fasteners are to be searched for.
iContextInVPMReferenceThe context product under which the fasteners are to be searched for.

ReturnType

List

Returns the list of fasteners fastening the given part and present under the given context product.

Example

Let iPart (ProductOccurence)
Let iContext (VPMReference)
Let ListOfFasteners (List)
ListOfFasteners = RetrieveFastenersInContext (iPart, iContext)