Message 1 of 2
occurrence parent = pattern

Not applicable
10-28-2015
01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a external rule that replaces occurrences.
Now I have to make an exclusion for some occurrences in a pattern.
My solution is to check if the occurrence is inside a pattern with a specfic name (oPat.Name.Contains("#Sub"))
I made working code the other day , accidently deleted my code, and now I can't replicate it anymore.
Note: I do not want to use oOcc.ispatternelement, I want to check the name of the parent if that parent is a pattern.
SyntaxEditor Code Snippet
Dim oDoc As AssemblyDocument = ThisDoc.Document Dim Occurrences As ComponentOccurrences = oDoc.ComponentDefinition.Occurrences Dim oOcc As ComponentOccurrence For Each oOcc In Occurrences If oOcc.Parent.Type = ObjectTypeEnum.kOccurrencePatternObject Then MsgBox("yay it works") End If Next
Thanks in advance
Arnold