I’m really a beginner. There are bunch of Information Names have to be renamed in the Material Brower. What I need is to change the names in red lines from “Poche” to “Redfab”. How could I change them in dynamo? Thank you so much!!
I got one dyn file from the Internet to rename the Material names but I don’t know how to rename the Appearance Information Names.
Python Script:
import clr
from System.Collections.Generic import *
Thanks myrwen.junterealSJC7
Maybe I did not explain clearly or did something wrong. I tried your suggestion but changed one “Information Name” only. How could I change them all in one time? As the image below.
Thanks again!
Something like that to change the keyword.
To be improved if it is necessary to define several values.
def toList(obj):
if hasattr(obj, '__iter__'): return obj
else: return [obj]
mats = toList(UnwrapElement(IN[0]))
value = toList(IN[1])[0]
for mat in mats :
appearanceAssetId = mat.AppearanceAssetId
assetElem = doc.GetElement(appearanceAssetId)
TransactionManager.Instance.EnsureInTransaction(doc)
with Visual.AppearanceAssetEditScope(assetElem.Document) as editScope:
editableAsset = editScope.Start(assetElem.Id)
key = editableAsset.FindByName("keyword")
if key.IsValidValue(value):
key.Value = value
editScope.Commit(True)
TransactionManager.Instance.TransactionTaskDone()
So i can feed something like this into IN1 "keyword1, keyword2, keyword3"?
Changing ‘keyword’ into ‘description’ would that work for changing Description values?
Or is that thought to simple?
Man, i wish changing Material (Asset) Parameters would be as simple as Family (Element) Paramters. . I really need to start learning Python, that is certain now…