General InformationThis action rule is invoked when you click Part Planning. Input ObjectsInput objects must be of the following type: Parameters correspond to the context object.ExampleThe 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.
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)
| |||||||||||||||||