General InformationThis action rule is invoked when you click the Advanced Connection command. Input ObjectsInput objects must be of the following type:
SampleThe following sample explains the KDNV action rule for advanced connection. /* Stiffener1:SldStiffener, Stiffener2:SldStiffener, outputs:List */ /* Variables for Stiffener */ let Support1(Feature) let Support2(Feature) let LimitingObject(Feature) let existingLimitType(Integer) let stfLimitType(Integer) /* Variables for Endcut */ let needEndcut(Boolean) let EndcutFeature(Feature) let Endcut1(SldEndcut) let OperatedStiffener(SldStiffener) let sectionName2(String) let existingEndcutName(String) let endcutType(String) let endcutName(String) let vpG(ValuePointer) let endcutGap(Real) let endcutA2(Real) let endcutL2(Real) let endcutD2(Real) /* Variables for Slot */ let needSlot(Boolean) let Panel2(SldPanel) let PanelFeature(Feature) let SlotFeature(Feature) let Slot1(SldSlot) let OperatedPanel(SldPanel) let PenetratingProfile(SldStiffener) let sectionName1(String) let existingSlotName(String) let slotType(String) let slotName(String) /* Variables for Bracket */ let PartFeature1(PartFeature) let needBracket(Boolean) let BracketSet1(Feature) let ConnectionSet(Feature) let AdvConnectionSet(Feature) let AdvCnx1(SldAdvConnection) let vpWebHeight1(ValuePointer) let vpWebHeight2(ValuePointer) let actionRuleName(String) let WebHeightParam1(Feature) let WebHeightParam2(Feature) let webHeight1(Real) let webHeight2(Real) let webHeight(Real) let TableFeature(Feature) let BracketTable1(DTSheetType) let classificationSociety(Integer) let rowIndex(Integer) let index1(Integer) let index2(Integer) let bracketDimension(String) let stringWeldLen(String) let stringThk(String) let lengthOfString(Integer) let armLength1(Real) let armLength2(Real) let bracketThk(Real) let LowerStiffener(SldStiffener) let ChildrenList1(List) let ChildrenList2(List) let EndcutParams(List) let Bracket1(SldSketchBasedPlate) let category1(String) let category2(String) let positionMode(Integer) let contourName(String) let bracketReferenceType(String) let bracketWeldedOnTop(Boolean) let bracketOrientation(Integer) let BaseSketchFeature(Feature) let BaseSketch(Sketch) let vpParam1(ValuePointer) let vpParam2(ValuePointer) let SupportOffsetFeature(Feature) let vpSupportOffset(ValuePointer) let supportOffset(Real) let ThicknessFeature(Feature) let vpThickness(ValuePointer) let OffsetFeature(Feature) let vpOffset(ValuePointer) let supportName(String) let RFGGridFace1(RFGGridFace) /* Variables for Flange */ let needFlange(Boolean) let Flange1(SldFlange) let flangeOrientataion(Integer) /* Common variables */ let PenetratingFeature(Feature) let OperatedFeature(Feature) let i(Integer) /* Get previous outputs */ i = 1 for i while i <= outputs->Size() { if( NULL == Endcut1) set Endcut1 = outputs->GetItem(i) if( NULL == Slot1) set Slot1 = outputs->GetItem(i) if( NULL == Bracket1) set Bracket1 = outputs->GetItem(i) if( NULL == Flange1) set Flange1 = outputs->GetItem(i) } /* Empty output list */ outputs->RemoveAll() /* Check that Stiffener1 and Stiffener2 use the same supports */ if( NULL <> Stiffener1 and NULL <> Stiffener2 ) { Support1 = NULL Support2 = NULL Stiffener1->GetSecondSurface(Support1) Stiffener2->GetSecondSurface(Support2) } if( NULL <> Support1 and NULL <> Support2 and Support1 == Support2 ) { /********************************Manage Limit of Stiffener********************************/ LimitingObject = NULL Stiffener2->GetLimitingObject(1, LimitingObject) /* Get start limit */ if( LimitingObject <> Stiffener1 ) Stiffener2->SetLimitingObject(1, Stiffener1) /* Condition1 : Type of relimitation */ existingLimitType = -1 Stiffener2->GetLimitType(1, existingLimitType) /* User can decide value of stfLimitType. */ /* ShortPoint = 0 LongPoint = 1 Weld = 2 */ stfLimitType = 0 if( existingLimitType <> stfLimitType ) Stiffener2->SetLimitType(1, stfLimitType) Stiffener2->Update() /********************************Manage Endcut********************************/ /* Condition2 : Create or not an Endcut */ /* User can decide value of needEndcut with reading an Endcut table */ needEndcut = true if( true == needEndcut ) { /* Condition3 : Endcut Parameters */ /* User can decide value of endcutType and endcutName. */ endcutType = "TRIM" endcutName = "" sectionName2 = "" Stiffener2->GetSectionName(sectionName2) if( "FL" == sectionName2->SearchPattern("FL") ) endcutName = "FL" else if( "HP" == sectionName2->SearchPattern("HP") ) endcutName = "HP" else if( "L" == sectionName2->SearchPattern("L") ) endcutName = "L" else if( "WT" == sectionName2->SearchPattern("WT") ) endcutName = "WT" endcutName = endcutName + "_" + ToLower(endcutType) + "_edge" if( NULL <> Endcut1 ) { OperatedFeature = NULL OperatedStiffener = NULL Endcut1->GetOperatedFunction(OperatedFeature) set OperatedStiffener = OperatedFeature existingEndcutName = "" Endcut1->GetName(existingEndcutName) if( OperatedStiffener <> Stiffener2 or existingEndcutName <> endcutName ) { OperatedStiffener->RemoveEndcut(1) Endcut1 = NULL } } if( NULL == Endcut1 ) { Stiffener2->AddEndcut(1, EndcutFeature) set Endcut1 = EndcutFeature } if( NULL <> Endcut1 ) { /* Set Endcut attributes */ Endcut1->SetType(endcutType) Endcut1->SetName(endcutName) Endcut1->InitByName(endcutName) /* Manage Endcut parameters */ /* User can decide value of Endcut parameters. */ /* ----------- parameter ---------- */ /* vpG = NULL vpG = Endcut1->GetAttributeValuePointer("G") if( NULL <> vpG ) vpG->SetValue("10mm") */ Endcut1->Update() outputs->Append(Endcut1) } } else { if( NULL <> Endcut1 ) { OperatedFeature = NULL OperatedStiffener = NULL Endcut1->GetOperatedFunction(OperatedFeature) set OperatedStiffener = OperatedFeature if( NULL <> OperatedStiffener ) { OperatedStiffener->RemoveEndcut(1) Endcut1 = NULL } } } /********************************Manage Slot********************************/ PanelFeature = NULL Stiffener2->GetFirstSurface(PanelFeature) set Panel2 = PanelFeature->Owner if( NULL <> Panel2 ) { /* User can decide value of needSlot with reading a Slot table */ needSlot = true if( true == needSlot ) { /* Condition4 : Slot parameters */ /* User can decide value of slotType and slotName. */ slotType = "BULB" slotName = "" sectionName1 = "" Stiffener1->GetSectionName(sectionName1) slotName = slotType +"_" +sectionName1 if( NULL <> Slot1 ) { OperatedFeature = NULL OperatedPanel = NULL Slot1->GetOperatedFunction(OperatedFeature) set OperatedPanel = OperatedFeature PenetratingFeature = NULL PenetratingProfile = NULL Slot1->GetPenetratingProfile(PenetratingFeature) set PenetratingProfile = PenetratingFeature existingSlotName = "" Slot1->GetName(existingSlotName) if( OperatedPanel <> Panel2 or PenetratingProfile <> Stiffener1 or existingSlotName <> slotName ) { OperatedPanel->RemoveSlot(Slot1) Slot1 = NULL } } if( NULL == Slot1 ) { Panel2->AddSlot(SlotFeature) set Slot1 = SlotFeature } if( NULL <> Slot1 ) { /* Set Slot attributes */ Slot1->SetPenetratingProfile(Stiffener1) Slot1->SetType(slotType) Slot1->SetName(slotName) /* Set slot paramters form the slot table */ Slot1->InitByName(slotName) /* Manage Slot parameters */ /* User can decide value of Slot parameters. */ /* ----------- parameter ---------- */ /* vpBOTC = NULL vpBOTC = Slot1->GetAttributeValuePointer("BOTC") if( NULL <> vpBOTC ) vpBOTC->SetValue("0mm") */ Slot1->Update() outputs->Append(Slot1) } } else { if( NULL <> Slot1 ) { OperatedFeature = NULL OperatedPanel = NULL Slot1->GetOperatedFunction(OperatedFeature) set OperatedPanel = OperatedFeature if( NULL <> OperatedPanel ) { OperatedPanel->RemoveSlot(Slot1) Slot1 = NULL } } } } |