Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This has me throwing my hands up, I cant figure this out...
So to recreate this behavior create a small sub-assembly with 2-3 positional Reps and place it in a new assembly.
create a Rule in iLogic called "PosRepSelector" and copy this code to the rule and then run it from your assembly with the sub-assembly in it.
after running the rule and changing the Positional Rep, if you try and place from Vault its now greyed out. this only happens when the rule has been ran. can anyone explain why?
oDoc = ThisDoc.ModelDocument If oDoc.DocumentType = kPartDocumentObject Then MessageBox.Show("This rule can only be ran in an Assembly file, exiting now.", "Message") Return End If Dim oTargetOcc As ComponentOccurrence Do While True oTargetOcc = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter,"Select Assembly to Modify... Press ESC to Cancel") If Not oTargetOcc Is Nothing Then Exit Do Else Dim oResultMsg As MsgBoxResult = MsgBox("No Assembly Selected... Exit?", 36, "Message") If oResultMsg = vbYes Then Return Else Return 'DO NOTHING KEEP LOOPING... End If End If Loop 'set a reference to the assembly component definition. 'This assumes an assembly document is open. Dim oCompDef As AssemblyComponentDefinition 'oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition oCompDef = oTargetOcc.Definition 'define pos rep Dim oPosRep As PositionalRepresentation Dim sPosRep As String Dim MyArrayList As New ArrayList 'record the active view rep name Dim sActivePosRep As String sActivePosRep = oCompDef.RepresentationsManager.ActivePositionalRepresentation.Name For Each oPosRep In oCompDef.RepresentationsManager.PositionalRepresentations MyArrayList.Add(oPosRep.Name) Next sPosRep = InputListBox("Select from the list:",MyArrayList, sActivePosRep, "iLogic", "Positional Reps") oCompDef.RepresentationsManager.PositionalRepresentations.Item(sPosRep).Activate oTargetOcc.ActivePositionalRepresentation = sPosRep
Solved! Go to Solution.