Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
mike.krudt
in reply to: bhavik4244

I'm not strong at Ilogic, so maybe you can help put these together.

I have this now:
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
	
If iProperties.Value(oOccurrence.Name, "Custom", "Type") = "CNC machined"
oOccurrence.Visible = True

Else
End If
Now it needs to look through all the Sub assemblies
with this code:
Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument

Dim oAsmDef As AssemblyComponentDefinition
oAsmDef = oAsmDoc.ComponentDefinition
Dim oLeafOccs As ComponentOccurrencesEnumerator
oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences

Dim oOcc As ComponentOccurrence
For Each oOcc In oLeafOccs
   'add previous rules

Next
What will the whole code look like?