Message 1 of 5

Not applicable
09-18-2019
09:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to create a SMART truck bed that is driven by a form. I have the bed, edging, center cut out & cut out trim all work great. But..now I have to make a cutout for out riggers and when the cut is made there are ends of the I-beam that are outside the cut area that need to be removed as well and I am not sure how to get that done.
PS
I am newish to programming in iLogic so the code is a bit spaghettied.
Code:
' ***User Parameters*** Parameter("CL_TRT_BX") = CL_TRT_BX Parameter("TRT_BX_HEIGHT") = TRT_BX_HEIGHT Parameter("TRT_BX_WIDTH") = TRT_BX_WIDTH Parameter("TRTBX_WIDTH_EDGE:1", "TRT_BX_WIDTH") = TRT_BX_WIDTH + 4 Parameter("TRTBX_HEIGHT_EDGE:1", "TRT_BX_HEIGHT") = TRT_BX_HEIGHT + 4 Parameter("FL_PNL:1", "BD_LENGTH") = TRIMED_BD_LENGTH Parameter("LNG_EDGE:1", "TOTAL_BD_LENGTH") = TOTAL_BD_LENGTH Parameter("RR_EDGE:1", "TOTAL_BD_WIDTH") = TOTAL_BD_WIDTH Parameter("FRNT_EDGE:1", "TOTAL_BD_WIDTH") = TOTAL_BD_WIDTH Parameter("SRPT_TUBE2:1", "LNG_SPPRT_TUBE_LNGTH") = LNG_SPPRT_TUBE_LNGTH NUM_CRSS_MEMBRS = Math.Round(Val(TOTAL_BD_LENGTH / 13), 0, MidpointRounding.AwayFromZero) If TOTAL_BD_WIDTH = 102 in Then Patterns.AddRectangular("Component Pattern 8:1", "FL_PNL:1", 13 ul, 8 in, "FL_PNL:1", "Edge0") ElseIf TOTAL_BD_WIDTH > 102 in Then Patterns.AddRectangular("Component Pattern 8:1", "FL_PNL:1", 12 ul, 8 in, "FL_PNL:1", "Edge0") End If 'ADDING TURRETBOX CUTOUT COMPONETS NUM_CRSS_MEMBRS Dim oAsmCompDef As AssemblyComponentDefinition oAsmDoc= ThisApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oAsmDoc.ComponentDefinition Dim oPat As OccurrencePattern oPat = oDef.OccurrencePatterns.Item("FLOOR Pattern 8:1") Dim oAssemblyFeatures As Features oAssemblyFeatures = oDef.Features Dim oAssemblyFeature As PartFeature 'Iterate through all of the assembly features For Each oAssemblyFeature In oAssemblyFeatures If oAssemblyFeature.Name = "TURRET BOX CUT OUT" Then 'look at the pattern elements Dim oPatE As OccurrencePatternElement For Each oPatE In oPat.OccurrencePatternElements 'look at the pattern element contents Dim oOcc As ComponentOccurrence For Each oOcc In oPatE.Occurrences 'add the element contents to the feature oAssemblyFeature.AddParticipant(oOcc) Next Next End If Next oPat = oDef.OccurrencePatterns.Item("BEAM Pattern 9:1") 'Iterate through all of the assembly features For Each oAssemblyFeature In oAssemblyFeatures If oAssemblyFeature.Name = "TURRET BOX CUT OUT" Then 'look at the pattern elements Dim oPatE As OccurrencePatternElement For Each oPatE In oPat.OccurrencePatternElements 'look at the pattern element contents Dim oOcc As ComponentOccurrence For Each oOcc In oPatE.Occurrences 'add the element contents to the feature oAssemblyFeature.AddParticipant(oOcc) Next Next End If Next oPat = oDef.OccurrencePatterns.Item("BEAM Pattern 9:1") 'Iterate through all of the assembly features For Each oAssemblyFeature In oAssemblyFeatures If oAssemblyFeature.Name = "RR MH CUTOUT" Then 'look at the pattern elements Dim oPatE As OccurrencePatternElement For Each oPatE In oPat.OccurrencePatternElements 'look at the pattern element contents Dim oOcc As ComponentOccurrence For Each oOcc In oPatE.Occurrences 'add the element contents to the feature oAssemblyFeature.AddParticipant(oOcc) Next Next End If Next
Solved! Go to Solution.