I want to rename an attribute dictionary (ad), but I have observed that the method #name can be used only for retrieving the name of the ad, and cannot be updated in the following way:
model_ads = Sketchup.active_model.attribute_dictionaries
ad = Sketchup.active_model.attribute_dictionary( "old_name" )
ad.name = "new_name" # Code Breaks Here
The solution I’ve been using so far is retrieveng all the data related to the ad, deleting it, and adding a new one with a new name and same data, in the following way:
data1 = ad['data1']
data2 = ad['data2']
data3 = ad['data3']
model_ads.delete( ad )
ad = Sketchup.active_model.attribute_dictionary( "new_name", true )
ad['data1'] = data1
ad['data2'] = data2
ad['data3'] = data3
Is this the only way to perform it, or is there anything that I am missing?