
Not applicable
03-05-2018
11:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The code below changes the occurrence attribute when called from the CommandCreatedHandler, but when I call this function in the CommandInputChangedHandler, it clears the selection input and does not permenantly change the occurrence attribute. Any help would be appreciated, as I am just beginning. def addOccurrenceAttribute(occurenceName, value): try: product = _app.activeProduct design = adsk.fusion.Design.cast(product) design.rootComponent.allOccurrences.itemByName(occurenceName).attributes.add("group","name",value) except: _ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Solved! Go to Solution.