def GetPattern(self, patternId: int):
try:<EOL><INDENT>pattern = self.Element.GetCurrentPattern(patternId)<EOL>if pattern:<EOL><INDENT>subPattern = CreatePattern(patternId, pattern)<EOL>self._supportedPatterns[patternId] = subPattern<EOL>return subPattern<EOL><DEDENT><DEDENT>except comtypes.COMError as ex:<EOL><INDENT>pass<EOL><DEDENT>
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern