- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous,
Please provide non confidential sample assembly to check the feasibility.
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Chandra,
Thanks for helping, please see the attached assembly and parts.
Adam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@Anonymous
Sorry for late reply,
iLogic rule inside parts are successfully executed and custom iProperty is also changed for selected component
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have managed to find a solution myself with some help from our resellers and to help anyone in the future it is below.
Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument
'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
Dim oValueList As New ArrayList
oValueList.Add("Awaiting Approval")
oValueList.Add("In Production")
oValueList.Add("Stock")
oValueList.Add("On Hold")
oValueList.Add("Site Measure")
Dim oValue As String = InputListBox("Select one option", oValueList, "In Production", "Set Status", "Available Selections")
'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 Inventor.ComponentOccurrence
If oSelected.Count >= 1 Then
For i =1 To oSelected.Count
Occ=oSelected.Item(i)
Parameter(Occ.Name, "Status") = oValue
iLogicVb.RunRule(Occ.Name, "Unit Status")
Next
End If