How do you 'know' for sure that setting the definition's attribute fails ?
You give insufficient detail.
If you use get_attribute() on the exact same definition [or instance.definition] you used set_attribute() on, then it should work.
Make sure the attribute-dictionary-name and the key are exactly the same in both cases, and that you have a default value set up too - like result = t_def.get_attribute(lib, 'trussfamily', 'WTF!').
If result == @Trussfamily it's working, but if result == 'WTF!' it's not !
Make sure you have presets for the 'value' set/get @Trussfamily, and of course the ' lib' - which should be the string-name of the dictionary, e.g. lib = 'medeek_truss_eng'.
It a dictionary of that exact name doesn't exist it's made, if it exists then it's reused...
Personally I'd use dictionary name starting with an uppercase letter, and all keys in lowercase.
There's less confusion that way...
To check what's dictionaries and keys/values are attached to a definition use something like this.
if t_def.attribute_dictionaries
t_def.attribute_dictionaries.each{|d|
puts "DICTIONARY == #{d.name}"
d.each_pair{|k, v|
puts "#{k} = #{v}"
}
}
else
puts "NO DICTS !"
end