The following sample illustrates how to refuse the creation of small clash interferences
when their penetration depth is under 2mm and their penetration volume is under 200m㎥.
/* Rule : PLMPIMOpeningIDCreationBL */
/*
ThisObject : #In PLMPIMMetricReference
Parameters : #In RuleContext
*/
/* Attr from ThisObject */
Let V_Itf_Type(String)
/* Attr from Parameters */
Let Quantifier(Length)
Let ClashVolume(Volume)
if (Parameters->HasAttribute("Quantifier"))
{
Quantifier = Parameters->GetAttributeReal("Quantifier")*1m
}
if (Parameters->HasAttribute("ClashVolume"))
{
ClashVolume = Parameters->GetAttributeReal("ClashVolume")*1m3
}
if (ThisObject->HasAttribute("V_Itf_Type"))
{
V_Itf_Type = ThisObject->GetAttributeString("V_Itf_Type")
if ((V_Itf_Type == "Clash") AND ((Quantifier < 2mm) AND (ClashVolume < 200mm3)))
{
Parameters.SetAttributeBoolean("CreateInterference", false)
}
}
The following sample illustrates how to modify the properties of interference entities
based on their type and numerical values.
/* Rule : PLMPIMOpeningIDCreationBL */
/*
ThisObject : #In PLMPIMMetricReference
Parameters : #In RuleContext
*/
/* Attr from ThisObject */
Let V_Itf_Type(String)
/* Attr from Parameters */
Let Quantifier(Length)
Let ClashVolume(Volume)
if (Parameters->HasAttribute("Quantifier"))
{
Quantifier = Parameters->GetAttributeReal("Quantifier")*1m
}
if (Parameters->HasAttribute("ClashVolume"))
{
ClashVolume = Parameters->GetAttributeReal("ClashVolume")*1m3
}
if (ThisObject->HasAttribute("V_Itf_Type"))
{
V_Itf_Type = ThisObject->GetAttributeString("V_Itf_Type")
if (V_Itf_Type == "Clash")
{
if (Quantifier < 2mm)
{
ThisObject.V_Itf_User_Type = "Potential_Clash"
ThisObject.V_description = "This clash is so small that we say it is a contact"
}
else if (ClashVolume > 500mm3)
{
ThisObject.V_description = "This clash must be analysed because it's volume is over 500mm3"
ThisObject.V_Itf_Analysis = "KO"
}
}
else if (V_Itf_Type == "Potential_Clash")
{
ThisObject.V_description = "It is ok, we don't check contacts"
ThisObject.V_Itf_Analysis = "OK"
ThisObject.V_Itf_User_Type = "No_Interference"
}
}
The following sample illustrates how to exclusively create interferences between IFC
AecWall and AecSlab elements.
/* Rule : PLMPIMOpeningIDCreationBL */
/*
ThisObject : #In PLMPIMMetricReference
Parameters : #In RuleContext
*/
/* Attr from Parameters */
let IFCtypes1(List)
let IFCtypes2(List)
let IFC_AecType1 (String)
let IFC_AecType2 (String)
set IFC_AecType1 = "NonIFCType"
set IFC_AecType2 = "NonIFCType"
Parameters.SetAttributeBoolean("CreateInterference", false)
/* Get IFC_Types_1 */
if ( Parameters->HasAttribute("IFC_Types_1") )
{
IFCtypes1 = Parameters->GetAttributeObject("IFC_Types_1")
let idx1 = 1
for idx1 while idx1 <= IFCtypes1.Size()
{
let IFC_Type1(String)
set IFC_Type1 = IFCtypes1->GetItem(idx1)
}
}
/* Get IFC_Types_2 */
if ( Parameters->HasAttribute("IFC_Types_2") )
{
IFCtypes2 = Parameters->GetAttributeObject("IFC_Types_2")
let idx2 = 1
for idx2 while idx2 <= IFCtypes2.Size()
{
let IFC_Type2(String)
set IFC_Type2 = IFCtypes2->GetItem(idx2)
}
}
/* Get last AEC type 1 */
if (IFCtypes1.Size() <= 3)
{
set IFC_AecType1 = IFCtypes1->GetItem(IFCtypes1.Size()-2)
}
/* Get last AEC type 2 */
if (IFCtypes2.Size() <= 3)
{
set IFC_AecType2 = IFCtypes2->GetItem(IFCtypes2.Size()-2)
}
/* Create interference only if between AecWall and AecSlab */
if ((IFC_AecType1 like "AecWall" or IFC_AecType1 like "AecSlab") and (IFC_AecType2 like "AecWall" or IFC_AecType2 like "AecSlab"))
{
Trace(1," Interference between AecWall and AecSlab CREATED ")
Parameters.SetAttributeBoolean("CreateInterference", true)
}
else
Trace(1," Interference between # and # NOT CREATED ", IFC_AecType1, IFC_AecType2)
Trace(1," ---------------------------------------------------------------------------------------------- ")