Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
duans5FLJC
281 Views, 2 Replies

Accessing the top level pattern name of an element that sits in a pattern within a pattern.

Good day

 

I have iLogic code that loops through occurrences in my assembly and suppresses or un-suppresses them based on criteria. When I have an element within a pattern, I can access its parent pattern name and suppress it by using the following: 

Component.IsActive(oOcc.PatternElement.Parent.Name) = False

But when I have a pattern of a pattern, and that element sits within the 'lower level' pattern, I can't use the same code. This code tries to suppress the lower-level pattern that sits within the top-level pattern and fails. So I need to access that top-level pattern name while looping to suppress it. But only if it is a multi-level pattern.

 

I found this post: https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/pattern-of-a-pattern-using-ilogic/m-.... But then I have to hardcode the parent pattern name, which I can't do.

 

Does anyone know how to do that?