Hanger and Support Types Methods

A method is a code block associated with a type, and which has access to its attributes.

This page discusses:

SptPrimarySupportOccurrence.ComputeValidationStatus()

This method returns the validation status between the primary support and the connected object at the certain position with given filter options.

Signature

SptPrimarySupportOccurrence.ComputeValidationStatus(ConnectedObject : Feature, LengthOnCurveFromStart : LENGTH, ListOfFilterOption : List, ValidationStatus : SptPrimarySupportValidationStatus, CheckComplianceWithSpecification : Boolean]) : Boolean

Arguments

Name Input/Output Required? Type Comment
ConnectedObject Input Yes Feature Can be either:
  • ProductOccurrence: Pipe, HVAC, Raceway tray
  • Feature: Branch
LengthOnCurveFromStart Input Yes LENGTH Length value computed from the start extremity of a curve to the position where the primary support exists on the curve.
ListOfFilterOption Input Yes List List of filter options
ValidationStatus Output Yes SptPrimarySupportValidationStatus Validation status
CheckComplianceWithSpecification Input Yes Boolean Optional parameter. To decide for checking the validation result according to the support specification or not. If this argument is not set, it will be treated as false. In the case of the primary support as a primary object, it will be always treated as false regardless of its input value.

ReturnType

Boolean

  • True: If the validation result is properly retrived.
  • False: If failed

Example

/* Input argument:
  ThisObject (SptPrimarySupportOccurrence)
*/

let listOfConnectedObj(List)
let listOfLength(List)
let listOfFilterOption(List)
let pConnectedObj(Feature)
let LengthOnCurve(LENGTH)
let index(Integer)
let ValidationStatus(SptPrimarySupportValidationStatus)
let bCheckComplianceWithSpec(Boolean) // Optional

// Set inputs for ComputeValidationStatus()
bCheckComplianceWithSpec = true
// This example uses all filter options
listOfFilterOption.Append("SptPSFilterOption_Distance")
listOfFilterOption.Append("SptPSFilterOption_OuterDiameter")
listOfFilterOption.Append("SptPSFilterOption_Width")
listOfFilterOption.Append("SptPSFilterOption_Height")
listOfFilterOption.Append("SptPSFilterOption_NominalSize")
listOfFilterOption.Append("SptPSFilterOption_Material")

if (true == ThisObject.GetConnectedObjects(listOfConnectedObj, listOfLength))
{
	if (0 == listOfConnectedObj.Size())
	{
		Notify("No connected object!")
		exit
	}
	if (listOfConnectedObj.Size() <> listOfLength.Size())
	{
		Notify("The number of result is not same!")
		exit
	}
	
	index= 1
	for index while index <= listOfConnectedObj.Size()
	{
		set pConnectedObj = listOfConnectedObj->GetItem(index)
		set LengthOnCurve = listOfLength->GetItem(index)
		if (NULL == pConnectedObj) 
		{
			Notify("Wrong result!")	
			continue
		}

		if (true == ThisObject.ComputeValidationStatus(pConnectedObj, LengthOnCurve, listOfFilterOption, ValidationStatus, bCheckComplianceWithSpec))
		{
			let sMessage(String)
			if  (ValidationStatus == "SptPSValidationStatus_NoConnection")
				sMessage = "Not connected!"
			if  (ValidationStatus == "SptPSValidationStatus_OutOfContext")
				sMessage = "Out of context!"
			if  (ValidationStatus == "SptPSValidationStatus_NotCompliantWithSpecification")
				sMessage = "Not compliant with specification!"
			if  (ValidationStatus == "SptPSValidationStatus_CompliantWithSpecification")
				sMessage = "Compliant with specification!"
			if  (ValidationStatus == "SptPSValidationStatus_Invalid")
				sMessage = "Invalid!"
			if  (ValidationStatus == "SptPSValidationStatus_Valid")
				sMessage = "Valid!"
			
			Notify("Name of connected object : " + pConnectedObj.Name)
			Notify("Length : " + LengthOnCurve)
			Notify("Validation status : " + sMessage)
		}
	}
}

SptPrimarySupportOccurrence.GetConnectedObjects()

This method returns the object connected to the primary support, and the position.

Signature

SptPrimarySupportOccurrence.GetConnectedObjects(ListOfConnectedObject : List, ListOfLengthOnCurveFromStart : List) : Boolean

Arguments

Name Input/Output Required? Type Comment
ListOfConnectedObject Output Yes List

List of connected object.

Can be either:

  • ProductOccurrence: Pipe, HVAC, Raceway tray
  • Feature: Branch

ListOfLengthOnCurveFromStart Output Yes List List of length value computed from the start extremity of a curve to the position where the primary support exists on the cure.

ReturnType

Boolean

  • True: If the connected objects and their positions are properly retrieved.
  • False: If failed.

Example

/* Input argument:
  ThisObject (SptPrimarySupportOccurrence)
*/

let listOfConnectedObj(List)
let listOfLength(List)
let pConnectedObj(Feature)
let LengthOnCurve(LENGTH)
let index(Integer)

if (true == ThisObject.GetConnectedObjects(listOfConnectedObj, listOfLength))
{
	if (0 == listOfConnectedObj.Size())
	{
		Notify("No connected object!")
		exit
	}
	if (listOfConnectedObj.Size() <> listOfLength.Size())
	{
		Notify("The number of result is not same!")
		exit
	}
	index= 1
	for index while index <= listOfConnectedObj.Size()
	{
		set pConnectedObj = listOfConnectedObj->GetItem(index)
		set LengthOnCurve = listOfLength->GetItem(index)
		if (NULL == pConnectedObj) 
		{
			Notify("Wrong result!")	
			continue
		}

		Notify("Name of connected object : " + pConnectedObj.Name)
		Notify("Length : " + LengthOnCurve)
	}		
}

SptPrimarySupportOccurrence.GetConnectionType()

This method returns the type of primary support connection. It represents whether the primary support is connected to the supportable object. Furthermore, whether it is the primary or secondary object in the connection. Primary object in the connection means the object driving the position of the secondary object.

Signature

SptPrimarySupportOccurrence.GetConnectionType(ConnectionType : SptPrimarySupportConnectionType) : Boolean

Arguments

Name Input/Output Required? Type Comment
ConnectionType Output Yes SptPrimarySupportConnectionType sptPrimarySupportConnectiontype

ReturnType

Boolean

  • True: If the connection type is properly retrieved.
  • False: If failed

Example

/* Input argument:
  ThisObject (SptPrimarySupportOccurrence)
*/

let PrimarySupportConnectionType(SptPrimarySupportConnectionType)
let sMessage(String)
if (true == ThisObject.GetConnectionType(PrimarySupportConnectionType))
{
	if (PrimarySupportConnectionType == "SptPSConnectionType_NoConnection")
		sMessage = "No connection"
	if (PrimarySupportConnectionType == "SptPSConnectionType_Primary")
		sMessage = "Primary (Support First)"
	if (PrimarySupportConnectionType == "SptPSConnectionType_Secondary")
		sMessage = "Secondary (Route First)"
	
	Notify("Connection type : " + sMessage)
}