Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have some code from an add-in I'm working on that worked several months ago.
# Set the spring color
fusionMaterials = _app.materialLibraries.itemByName('Fusion 360 Appearance Library')
appear = fusionMaterials.appearances.itemByName('Powder Coat (Blue)')
if strColor == 'Blue':
blueColor = design.appearances.addByCopy(appear, 'BlueColor') <<< Line 290
colorProp = adsk.core.ColorProperty.cast(blueColor.appearanceProperties.itemByName('Color'))
colorProp.value = adsk.core.Color.create(0, 0, 255, 0)
bd.appearance = blueColor
elif strColor == 'Red':
redColor = design.appearances.addByCopy(appear, 'RedColor')
colorProp = adsk.core.ColorProperty.cast(redColor.appearanceProperties.itemByName('Color'))
colorProp.value = adsk.core.Color.create(255, 0, 0, 0)
bd.appearance = redColor
elif strColor == 'Gold':
goldColor = design.appearances.addByCopy(appear, 'GoldColor')
colorProp = adsk.core.ColorProperty.cast(goldColor.appearanceProperties.itemByName('Color'))
colorProp.value = adsk.core.Color.create(204, 204, 0, 0)
bd.appearance = goldColor
else:
greenColor = design.appearances.addByCopy(appear, 'GreenColor')
colorProp = adsk.core.ColorProperty.cast(greenColor.appearanceProperties.itemByName('Color'))
colorProp.value = adsk.core.Color.create(0, 153, 0, 0)
bd.appearance = greenColor
I am now revising the code and I get this error message:
Has something changed in the API or is it my code?
Thanks in advance for any help.
Brad Bylls
Solved! Go to Solution.