Message 1 of 9

Not applicable
01-22-2014
11:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
(New Programmer)
Does anyone know how to control Positional Reps of a subassembly with Ilogic, What I'm trying to achieve is to change/set every other occurrence from Master Positional Design Rep to Position1 as you can see from the 2 attached pictures this can be done manually. Also I have been able to iterate through the occurrences and change the colours of every other cylinder please see pictures and the ilogic code I have put together through other peoples code (Many Thanks)
I would Appreciate any help I can get.
Thanks In Advance
Paul Hurley
' File path & File to use oPath = "Q:\Inventor\Development\Silo_Standardisation\Test Folder For Ilogic\iLogic Place Component in Assembly\iLogic Place Component in Assembly\STRAKE_PRIMARY_A.iam" Dim offsetCyl As Double = 1000 Dim cylHeight As Double = 181 Dim i As Integer = 0 Dim j As Integer = 0 Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oMatrix As Matrix = oTG.CreateMatrix Dim oOccurrence As ComponentOccurrence oMatrix.SetTranslation(oTG.CreateVector(0, 0, offsetCyl)) ' Insert Loop Dim Total As Integer Total = InputBox("Type How Many", "Insert", "3") For i = 1 To Total ' Place Assy oOccurrence = oAsmCompDef.Occurrences.Add(oPath, oMatrix) oMatrix.SetTranslation(oTG.CreateVector(0, 0, cylHeight * i + offsetCyl)) oOccurrence.Grounded = False Next i Dim StrakeString As String For j = 1 To Total Select Case j Case 1,3,5,7,9 StrakeString = "STRAKE_PRIMARY_A:" & j Component.Color(StrakeString)= "RED" MessageBox.Show(StrakeString, "Title") Case 2,4,6,8,10 StrakeString = "STRAKE_PRIMARY_A:" & j Component.Color(StrakeString)= "YELLOW" MessageBox.Show(StrakeString, "Title") End Select Next j ThisApplication.ActiveView.Fit
Solved! Go to Solution.