# Setting AppearanceAsset Properties

**URL:** <https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037>\
**Category:** Revit\
**Created:** [January 10, 2018, 8:13pm UTC](https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037 "2018-01-10T20:13:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@abhishek](https://forum.dynamobim.com/u/abhishek)\
**Post date:** [January 10, 2018, 8:13pm UTC](https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037/1 "2018-01-10T20:13:45Z")

</div>

Hi all,

I’ve been trying to read and set appearance asset properties for materials in R2018. So far, by following numerous code examples, I’ve been able to extract all the appearance asset properties. Basically I cobbled together code from within the Material.MaterialAssetElement node and buildingcoder blog ([http://thebuildingcoder.typepad.com/blog/2017/10/material-texture-path.html](http://thebuildingcoder.typepad.com/blog/2017/10/material-texture-path.html)) to get the following result…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/4/944410e6a37bad0dd29bb52b86b9b080e6a3a193.png)

Now I’m trying to set these properties (UIName, description and keyword, which is r\_asset[47]) but I’m getting the following error.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/3/03b77ade0ffad43dd64f9ac9e13fff01405d1879.png)

Does this have anything to do with editscope?

> **[Modifying Material Visual Appearance](https://thebuildingcoder.typepad.com/blog/2017/11/modifying-material-visual-appearance.html)**
>
> Question: How can I set the Material Render Appearance through the API?
> I can see there is the Autodesk.Revit.DB.Visual.Asset class, but how do I add to the list of Autodesk.Revit.DB.Visual.AssetProperty objects for a new material?
> Answer: The good...

Can someone please help me incorporate that example in a python script?

Thanks!

---

<div class="post-metadata">

**Author:** ![abhishek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@abhishek](https://forum.dynamobim.com/u/abhishek)\
**Post date:** [January 10, 2018, 9:31pm UTC](https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037/2 "2018-01-10T21:31:01Z")

</div>

I think I might have figured out the issue with Name…  
Changing the r\_asset lines to the following lines gave the desired output. ModName is just a list that contains the modified names to apply.

app\_asset = doc.GetElement(appId)  
app\_asset.Name = ModName[i]

However, I’m still struggling with description and keywords…

---

<div class="post-metadata">

**Author:** ![awilliams](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/awilliams/32/114496_2.png) [@awilliams](https://forum.dynamobim.com/u/awilliams)\
**Post date:** [January 10, 2018, 11:54pm UTC](https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037/3 "2018-01-10T23:54:03Z")

</div>

Could you copy and paste your Python script here as preformatted text (hit the \</\> button after pasting)? Will be easier to help without having to retype your code from the screenshot 🙂

---

<div class="post-metadata">

**Author:** ![abhishek](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@abhishek](https://forum.dynamobim.com/u/abhishek)\
**Post date:** [January 11, 2018, 12:13am UTC](https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037/4 "2018-01-11T00:13:59Z")

</div>

Sure, here’s the code for reading the properties -

appElem = UnwrapElement(IN[0])

id\_List=[]  
NameList=[]  
DescriptionList=[]  
KeywordList=[]

for a in appElem:  
id\_List.append([a.Id](http://a.Id))  
r\_asset = a.GetRenderingAsset()  
try:  
NameList.append(r\_asset[“UIName”].Value)  
except:  
NameList.append("!!!")  
try:  
DescriptionList.append(r\_asset[“description”].Value)  
except:  
DescriptionList.append("!!!")  
try:  
KeywordList.append(r\_asset[47].Value)  
except:  
KeywordList.append("!!!")

OUT = id\_List, NameList, DescriptionList, KeywordList  
indent preformatted text by 4 spaces

I deleted the second script so don’t have that to paste, sorry.

---

<div class="post-metadata">

**Author:** ![markus.valle-klann](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/markus.valle-klann/32/59991_2.png) [@markus.valle-klann](https://forum.dynamobim.com/u/markus.valle-klann)\
**Post date:** [June 16, 2021, 7:55pm UTC](https://forum.dynamobim.com/t/setting-appearanceasset-properties/18037/5 "2021-06-16T19:55:36Z")

</div>

@abhishek : any progress on this? I’d be interested in setting appearance asset properties via Dynamo myself and haven’t found any existing solution yet. I’ve looked at the [archi-lab.net](http://archi-lab.net) c# implementation for setting some of the parameters in [AppearanceAssets.cs](https://github.com/ksobon/archilab/blob/e66705d34e8262a509110773dcbe877d5a8d2511/archilabSharedProject/Revit/Elements/AppearanceAssets.cs). You might also find Konrad’s [article](https://archi-lab.net/few-more-comments-about-materials-in-revit-dynamo-apis-etc/) on the subject helpful.
