a little bit more information:
Standard DC definition attributes (dynamic_attributes):
Retrieve with (for the selected instance):
xx=Sketchup.active_model.selection[0].definition.attribute_dictionaries['dynamic_attributes']
xx.each{|key,value| puts key.to_s+'-'+value.to_s}
Returns (app. depending on user set attributes of the selected instance-in this case LenX and LenY are 'user cannot see' and material is 'user can see'):
_formatversion-1.0
_has_movetool_behaviors-0.0
_hasbehaviors-1.0
_lastmodified-2012-02-21 10:13
_lengthunits-CENTIMETERS
_lenx_access-NONE
_lenx_formlabel-LenX
_lenx_label-LenX
_lenx_units-DEFAULT
_leny_access-NONE
_leny_formlabel-LenY
_leny_label-LenY
_leny_units-DEFAULT
_material_access-VIEW
_material_formlabel-Material
_material_label-Material
_material_units-STRING
_name-Huis1
lenx-393.700787401575
leny-393.700787401575
material-
When changing LenX and LenY to 'user can see':
_formatversion-1.0
_has_movetool_behaviors-0.0
_hasbehaviors-1.0
_lastmodified-2012-02-21 10:15
_lengthunits-CENTIMETERS
_lenx_access-VIEW
_lenx_formlabel-LenX
_lenx_label-LenX
_lenx_units-DEFAULT
_leny_access-VIEW
_leny_formlabel-LenY
_leny_label-LenY
_leny_units-DEFAULT
_material_access-VIEW
_material_formlabel-Material
_material_label-Material
_material_units-STRING
_name-Huis1
lenx-393.700787401575
leny-393.700787401575
material-
Standard instance attributes (dynamic_attributes):
xx=Sketchup.active_model.selection[0].attribute_dictionaries['dynamic_attributes']
xx.each{|key,value| puts key.to_s+'-'+value.to_s}
_has_movetool_behaviors-0.0
_hasbehaviors-1.0
lenx-393.700787401575
leny-393.700787401575
Now if you add an attribute on definition level eg. LenX this is accessible as lenx for both the comp. definition as the instance.
Important: to be able to access that value on instance level with _lenx_formula (eg. to change the value) the attribute must be set to at least 'users can see this attribute' . Otherwise it cannot be changed through ruby.
If I get out more information, I'll post it here.