Part Planning Rule

This action rule is invoked when you use Part Planning.

This page discusses:

See Also
Checker Rule
Naming Rule
Opening Rule
Part Computation Rule
Profile Rule
Shrinkage Compensation Rule
Weld Rules
Workshop Document Rule

General Information

This action rule is invoked when you click Part Planning.

Input Objects

Input objects must be of the following type:

Parameters correspond to the context object.

Example

The following example shows an EKL rule to determine whether to treat the manufactured part as straight or curved. You can use this example to make another script in the action rule.

  • If the variable returns "0", then the Mfg part is treated as a straight part.
  • If the variable returns "1", then the Mfg part is treated as a curved part.
Tip: Define a tolerance setting to declare a minimum for bent, rolled and twisted values, to ensure that they are treated as flat from the start.

let mfgProcItem(MfgProcessOccurrence)
let mfgItem(ElementaryEndItem)
let procOutput(VPMReference)
let SDDDesignProduct(VPMReference)
let DesignPlate(Structure_Plate)
let DesignProfile(Structure_Stiffener)
let CurvatureType(String)
let Deflection(LENGTH)
let Tolerance(LENGTH)
let ProfileSection(String)
let PartPlanningAttrList(List)
let bIsCurvedPart(Boolean)
let SurfaceName(String)

bIsCurvedPart=True
set mfgProcItem= Parameters.GetAttributeObject("ManufacturedItem")
set CurvatureType=Parameters.GetAttributeString("CurvatureType")
set Tolerance=0.005mm

if mfgProcItem <> NULL
{
	set mfgItem = mfgProcItem.Reference
	set procOutput = mfgItem.GetProcessOutput()
	
	set SDDDesignProduct = procOutput.GetStructureDesignObject()
	if SDDDesignProduct <> NULL
	{
		set DesignPlate = SDDDesignProduct
		set DesignProfile = SDDDesignProduct
		if DesignPlate <> NULL
		{
			SurfaceName="Plate_MfgSurface"
			set Deflection = procOutput.GetDeflectionValue(SurfaceName)
			if(Deflection < Tolerance)
				set bIsCurvedPart=False
			
		}
		else if DesignProfile <> NULL
		{
			ProfileSection=DesignProfile.V_StrSection
			
			let setting (SystemSetting)
			let settingAttr (Integer)
			let settingAttrValue(String)
			let RetrievedFromPrefSetting(Boolean)
			RetrievedFromPrefSetting = false
			settingAttr = 0
			setting = RetrieveSystemSetting("DELStrMfgToolsOptsWorkShopDoc")
			if (NULL<>setting) 
			{
				if (setting->HasAttribute("ProfileXMLConversionOption")) 
				{
					settingAttr = setting->GetAttributeInteger("ProfileXMLConversionOption")
					if(settingAttr == 1)
					 {
						settingAttrValue = setting->GetAttributeString("SectionListProfileXMLConversion")
						if(ProfileSection.SearchPattern("FL") == "FL")
						{
							set bIsCurvedPart=False
							RetrievedFromPrefSetting = true
						}
					}
				}
			}
			if(RetrievedFromPrefSetting == false)
			{
				if("Bent" == CurvatureType)
				{
					ProfileSection=DesignProfile.V_StrSection
					if(ProfileSection.SearchPattern("FL") == "FL")
					{
						set bIsCurvedPart=False
					}
					else
					{
						SurfaceName="Profile_Flange"
						set Deflection = procOutput.GetDeflectionValue (SurfaceName) 
						if(Deflection < Tolerance)
						{
							set bIsCurvedPart=False
						}
					}
				}
				else if ("Rolled" == CurvatureType)
				{
					SurfaceName="Profile_Web"
					set Deflection = procOutput.GetDeflectionValue (SurfaceName) 
					if(Deflection < Tolerance)
					{
						set bIsCurvedPart=False
					}
				}
				else if ("Twisted" == CurvatureType)
				{
					SurfaceName="Profile_Flange"
					set Deflection = procOutput.GetDeflectionValue (SurfaceName) 
					let WebDeflection(LENGTH)
					SurfaceName="Profile_Web"
					set WebDeflection = procOutput.GetDeflectionValue (SurfaceName) 
					if(WebDeflection > Deflection)
{
						set Deflection = WebDeflection
					}
					if(Deflection < Tolerance)
					{
						set bIsCurvedPart=False
					}
				}
			}
		}
		
	}
}
SetDSTFeatureAttributeIntoList(PartPlanningAttrList, "IsCurvedPart", bIsCurvedPart)
Parameters.SetAttributeObject("PartPlanningAttrList", PartPlanningAttrList)