Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
I try do iLogic rule that disable participate sections for selected parts in assembly. Below picture with that what i mean.
Below is my rule. I try Set my setting for parts form ObjectCollection, and I receive some errors.
Can anyone get me some tips?
Dim oDocAssem As AssemblyDocument
oDocAssem = ThisApplication.ActiveDocument
Dim oSelected As ObjectCollection
oSelected = ThisApplication.TransientObjects.CreateObjectCollection
Dim oCount As Long
oCount = oDocAssem.SelectSet.Count
If oCount = 0 Then
MessageBox.Show("Select one or more part.", "iLogic")
Return
End If
Dim i As Integer
For i = 1 To oCount
If oDocAssem.SelectSet.Item(i).Type = _
ObjectTypeEnum.kComponentOccurrenceObject Then
oSelected.Add (oDocAssem.SelectSet.Item(i))
End If
Next
Dim oDoc As Document
For Each oDoc In oSelected
Dim oPartDoc As PartDocument
oPartDoc = oDoc
'Disable the part section.
oPartDoc.ModelingSettings.AllowSectioningThruPart = False
Next
MessageBox.Show("Done!", "iLogic")
Solved! Go to Solution.