Not applicable
09-10-2020
05:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
We use a lot of ilogic and rules but I can't figure how to get this process to work, I hope you can help me.
Intended workflow - ilogic rule to run in an assembly
- Opens up a detailed BOM list (shows multiple instances of the same part, 1.1, 1.2 etc.) and allows selection of the parts required
- The parts selected are highlighted in the assembly window
- When a button is clicked the below happens for each selected part
- the parameter called "Status" is changed to "In Production"
- A rule called "UnitStatus" is run
This is all run in Vault and so in an ideal world I would like to also run the below when the button is clicked on each selected part
- Change to 'In Design' if not already
- Checkout part to allow change to be saved
I realise this might be asking a lot but even if I can manually select them in the window or type the item numbers into a text box it'd be a great time saver
This is my code so far but it doesn't work and obviously I'm working on the basic window selection version.
Dim oDoc As Document
Dim oPart As AssemblyComponentDefinition
oDoc = ThisApplication.ActiveDocument
oPart = oDoc.ComponentDefinition
'selected components collection
Dim oSelected As ObjectCollection
oSelected = ThisApplication.TransientObjects.CreateObjectCollection
'Check that at least 1 is selected
If oDoc.SelectSet.Count = 0 Then
'MessageBox.Show("Please select a component.", "iLogic")
Exit Sub 'bail out
End If
'add to Object Collection
For i = 1 To oDoc.SelectSet.Count
If TypeOf oDoc.SelectSet.Item(i) Is ComponentOccurrence Then
oSelected.Add (oDoc.SelectSet.Item(i))
End If
Next
Dim Occ As ComponentOccurrence
If oSelected.Count >= 1 Then
For i =1 To oSelected.Count
Try
Parameter.Param("Status").Expression = "In Production"
iLogicVb.RunRule(Occ, "UnitStatus")
Catch
End Try
Next
End If
Any help is welcome, thanks
Adam
Solved! Go to Solution.
