Attribute Synchronization Action Rule

This action rule synchronizes the user-defined attributes of the structure plate with the corresponding attributes of the split plate.

This page discusses:

Arguments

Name Type
SplitPlateFeatureObject SddSplitPlate
ExposedPlateObject Structure_Plate

Sample

let FeatureAttributeList(List)
let ExposedPlateAttributeList(List)
let FeatureAttributeListIterator(Integer)
let ExposedPlateAttributeListIterator(Integer)
let FeatureAttributeListSize(Integer)
let ExposedPlateAttributeListSize(Integer)
let BooleanFeatureValue(Boolean)
let DateFeatureValue(Date)
let IntegerFeatureValue(Integer)
let RealFeatureValue(Real)
let StringFeatureValue(String)
let CurrentFeatureAttribute(String)
let CurrentExposedPlateAttribute(String)
let FeatureAttributeType(String)
let ExposedPlateAttributeType(String)

set FeatureAttributeList = SplitPlateFeatureObject->ListAttributeNames("Literal",true)
set FeatureAttributeListSize = FeatureAttributeList.Size()
set ExposedPlateAttributeList=ExposedPlateObject->ListAttributeNames("Literal",false)
set ExposedPlateAttributeListSize = ExposedPlateAttributeList.Size()

set FeatureAttributeListIterator=1

for FeatureAttributeListIterator while FeatureAttributeListIterator<=FeatureAttributeListSize
{
  set CurrentFeatureAttribute=FeatureAttributeList.GetItem(FeatureAttributeListIterator)
  set FeatureAttributeType=SplitPlateFeatureObject->AttributeType(CurrentFeatureAttribute)

  set BooleanFeatureValue=SplitPlateFeatureObject->GetAttributeBoolean(CurrentFeatureAttribute)
  set DateFeatureValue=SplitPlateFeatureObject->GetAttributeDate(CurrentFeatureAttribute)
  set IntegerFeatureValue=SplitPlateFeatureObject->GetAttributeInteger(CurrentFeatureAttribute)
  set RealFeatureValue=SplitPlateFeatureObject->GetAttributeReal(CurrentFeatureAttribute)
  set StringFeatureValue=SplitPlateFeatureObject->GetAttributeString(CurrentFeatureAttribute)

  set ExposedPlateAttributeListIterator=1
  for ExposedPlateAttributeListIterator while ExposedPlateAttributeListIterator<=ExposedPlateAttributeListSize
  {
    set CurrentExposedPlateAttribute=ExposedPlateAttributeList.GetItem(ExposedPlateAttributeListIterator)
    if CurrentFeatureAttribute == CurrentExposedPlateAttribute
    {
      set ExposedPlateAttributeType=ExposedPlateObject->AttributeType(CurrentExposedPlateAttribute)
      if FeatureAttributeType == ExposedPlateAttributeType
      {
        if ExposedPlateAttributeType == "String"
        {
          ExposedPlateObject->SetAttributeString(CurrentExposedPlateAttribute, StringFeatureValue)
        }
        else if ExposedPlateAttributeType == "LENGTH"
        {
          ExposedPlateObject->SetAttributeReal(CurrentExposedPlateAttribute, RealFeatureValue)
        }
        else if ExposedPlateAttributeType == "AREA"
        {
          ExposedPlateObject->SetAttributeReal(CurrentExposedPlateAttribute, RealFeatureValue)
        }
        else if ExposedPlateAttributeType == "Integer"
        {
          ExposedPlateObject->SetAttributeInteger(CurrentExposedPlateAttribute, IntegerFeatureValue)
        }
        else  if ExposedPlateAttributeType == "Boolean"
        {
          ExposedPlateObject->SetAttributeBoolean(CurrentExposedPlateAttribute, BooleanFeatureValue)
        }
      }
    }
  }
}