return a list of tags of the selected features

Forums: 

Following this and this question, I want to get the list of tags/identifiers of the selected objects. This post mentions the NXOpen.UiStyler.DialogItem class. But I get the error message

AttributeError: 'module' object has no attribute "UiStyler"

Ideally I would like to do this code block:

import NXOpen

def main() :

select = NXOpen.UiStyler.DialogItem.GetSelectionHandle()

if __name__ == '__main__':
main()

I think you posted your solution here:
https://community.sw.siemens.com/s/question/0D54O00006ceqoOSAQ/assign-a-...

Or did you still need help with this?


import NXOpen

def get_selected_object():
theUI = NXOpen.UI.GetUI()
number_of_object = theUI.SelectionManager.GetNumSelectedObjects()
object_list = [theUI.SelectionManager.GetSelectedTaggedObject(i) for i in range(number_of_object)]
return object_list