Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using the new color properties code to create a new steel property.
The color code works very well, but I can't get the syntax correct for the new steel.
No help in the documentation for this that I can find.
This code works great.
fusionMaterials = _app.materialLibraries.itemByName('Fusion 360 Appearance Library')
appear = fusionMaterials.appearances.itemByName('Powder Coat (Blue)')
yellowColor = design.appearances.addByCopy(appear, 'YellowColor')
colorProp = adsk.core.ColorProperty.cast(yellowColor.appearanceProperties.itemByName('Color'))
colorProp.value = adsk.core.Color.create(204, 204, 0, 0)
plateTCPbody.appearance = yellowColor
fusionMaterials = _app.materialLibraries.itemByName('Fusion 360 Material Library')
metalProp = fusionMaterials.materials.itemByName('Copper')
steel1030 = design.materials.addByCopy(metalProp, 'steel1030')
metalPropty = adsk.core.Materials.cast(steel1030.materialProperties.itemByName('steel1030'))
metalPropty.value = adsk.core.Material.create('N0. 1 Steel (SAE 1030)')
plateTCPbody.material = steel1030
Brad Bylls
Solved! Go to Solution.