Overwrite Appearance of Brep Face
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have added two named Appearances to my appearance library each with unique names. I have a program that is iterating through faces and passing them into a helper function that will change the appearance of the face. The desired result is to color different faces in a single body differently using differently colored appearance objects. However, when I run the add-in, none of the faces have visibly changed. However, one extra copy of the body's original appearance (in this case steel satin) now shows up in the appearances panel. Here is a stripped down version of my code:
def validate(face, color): try: app = adsk.core.Application.get(); ui = app.userInterface; design = app.activeProduct paramList = design.userParameters apps = design.appearances badAlt = apps.itemByName("Short Altitude") badSide = apps.itemByName("Short Side") if not badAlt or not badSide: ui.messageBox("Appearance 'Short Altitude' or appearance 'Short Side' not found") if color: face.appearance = badSide else: face.appearance = badAlt
except:
ui.messageBox("Error: Validate Failed")
Any ideas what I am doing wrong? (Note: I am using the dev build of Fusion, in case that is relevant). Note: if I change "face.appearance" to junk like "face.asdf" the program executes with our any errors reported, including the messagebox in my except block. I also placed test message boxes before and after "face.apperance = badSide" and both message boxes were reached including when I replaced appearance with "asdf". really not sure what's happening here...