- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
i am having a bit of an issue with the AddMate and AddInsert snippets in iLogic. i am writing a rule that will add components to an assembly (no issue). once i bring the component in, i want to mate it to features in the proceeding component. if i use the actual names of the parts they will mate as they should. however, i want to cycle thru, setting my new part name to a variable (LAST_PLATE), and then add the mate. As we could be adding from 3-12 components, we need to have this "LAST_PLATE" change to the last component added. as soon as i place the variable into the code instead of the actual name, it craps out.. is there something i'm missing in parsing these variables in the addmate command? i'included the snippet here, and also a screen dump of the ilogic window and assembly tree. i've hilited in RED the line i'm having issues with...
For Each wrd In Words PLATE_NAME = "PLATE-" & (i + 1) Logger.Debug(PLATE_NAME) MessageBox.Show(PLATE_NAME, "PLATE #") Dim componentA = Components.Add(PLATE_NAME, "SC-H-2R-P1.ipt", position := Nothing, grounded := GROUND, visible := True, appearance := Nothing) If i = 0 Then LAST_PLATE = PLATE_NAME GROUND=False i = i + 1 GoTo JUMP_NEXT End If LAST_PLATE = PLATE_NAME MessageBox.Show(LAST_PLATE, "LAST PLATE") Constraints.AddMate("Mate:1", "PLATE-2", "CH-4", "PLATE-1", "CH-3", e1InferredType := InferredTypeEnum.kInferredLine, e2InferredType := InferredTypeEnum.kInferredLine, solutionType := MateConstraintSolutionTypeEnum.kOpposedSolutionType) Constraints.AddInsert("", LAST_PLATE, "PEAK-2", PLATE_NAME, "PEAK-1", axesOpposed := True, distance := 0.0, lockRotation := False, biasPoint1 := Nothing, biasPoint2 := Nothing) 'Constraints.AddMate("Mate1", "PLATE-1", "CH-2", "PLATE-2", "CH-1", ' offset := 0.0, e1InferredType := InferredTypeEnum.kNoInference, e2InferredType := InferredTypeEnum.kNoInference, ' solutionType := MateConstraintSolutionTypeEnum.kNoSolutionType, ' biasPoint1 := Nothing, biasPoint2 := Nothing) 'Constraints.AddInsert("", "PLATE-1", "CH-2", "PLATE-2", "CH-1", ' axesOpposed := False, distance := 0.0, lockRotation := False, biasPoint1 := Nothing, biasPoint2 := Nothing) Constraints.AddInsert("", "PLATE-1", "PEAK-2", "PLATE-2", "PEAK-1", axesOpposed := True, distance := 0.0, lockRotation := False, biasPoint1 := Nothing, biasPoint2 := Nothing) i = i + 1 Logger.Debug("I = "& i) JUMP_NEXT: Next
thanks in advance for any insight!
Solved! Go to Solution.